C++ again: Equivalent for ostream 
Author Message
 C++ again: Equivalent for ostream

Hello!

I hope I am right with the assumption that a kind of an "c++ ostream"
can be created by just using
FreeFile and Print, etc... in Vb6.
But is there maybe anything a little closer to it? ostreams occur often
in my code, and if it's possible I would like to include not so many
workarounds.

Thanks!
Reiner



Mon, 13 Feb 2012 21:36:40 GMT  
 C++ again: Equivalent for ostream


Quote:
> Hello!

> I hope I am right with the assumption that a kind of an "c++ ostream"
> can be created by just using
> FreeFile and Print, etc... in Vb6.
> But is there maybe anything a little closer to it? ostreams occur often
> in my code, and if it's possible I would like to include not so many
> workarounds.

Depends on what it is you are trying to do, or I guess, rather what the
application you are porting is trying to do. i/ostream is most often used in
the context of a console application (aka DOSPrompt Window), so I assume it
is a console application. VB has limited support for consoles. Take a look
at these ...

"Creating a real console application in Visual Basic"
http://www.nirsoft.net/vb/console_application_visual_basic.html

"Make a console application"
http://www.vb-helper.com/howto_make_console_app.html

"Classic VB Console"
http://vb.mvps.org/samples/Console/

You might consider converting from a console application to a Windows one,
in which case receiving input, validating it, and writing and formatting
output using TextBoxes is a far simpler process.

-ralph



Mon, 13 Feb 2012 22:29:27 GMT  
 C++ again: Equivalent for ostream
No, it deals with writing to XML files.


Mon, 13 Feb 2012 23:30:51 GMT  
 C++ again: Equivalent for ostream
Would ADODB.Stream be good?


Tue, 14 Feb 2012 00:45:17 GMT  
 C++ again: Equivalent for ostream

Quote:
> Would ADODB.Stream be good?

I don't think so, use VB's File I/O. See also:

http://en.wikipedia.org/wiki/Iostream

There are also other ways to write XML from VB.



Tue, 14 Feb 2012 01:16:01 GMT  
 C++ again: Equivalent for ostream


Quote:
> Would ADODB.Stream be good?

ha, that was unexpected.

The ADODB.Stream object would be an interesting fit for a C++ to VB port. It
has the advantage of being an 'object' and in presenting a very similar
interface to iostream. You could likely convert a lot of code practically in
situ.

It is/was popular with web developers since it runs out-proc and thus a tool
for interprocess communications. However, because of its early problems with
security issues it fell out of favor (in some cases adminisrators even turn
it off).

The other problem is it is bulky, even shall we say over-kill, for just
performing File I/O. Also in this context (xml and perhaps urls?) you will
likely run through a couple of OLE DB Provider builds before you find one
that is less buggy than the others.
[Remember there is always a difference between what the ADO specs say, and
what any particular OLE DB Provider is willing do.]
However, I haven't used it for awhile, things may have changed.

I kind of like the idea though. If I were you, and didn't have anyone
breathing down my neck, I would probably try it. At least as a first pass in
getting something to run in "VB". But ...

meanwhile, I also go along with Nobody - there are other ways, probably
better ways - and investigate some other tools. There is just something more
appealing with using VB's File I/O within a VB application. <grin>

-ralph



Tue, 14 Feb 2012 02:31:21 GMT  
 C++ again: Equivalent for ostream
Okay, thanks.


Tue, 14 Feb 2012 03:04:38 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. VB.net equivalent to C++ macros __FILE__ and ___LINE__

2. VB equivalent of C++ pointers??

3. Basic equivalent for C++ Union??

4. visual C++ method that's equivalent to usercontrol.asyncread method in vb

5. C++ equivalent for VB Typename()

6. VB equivalent of C++ switch "fallthrough"?

7. C++ equivalent for VB Typename()

8. C++ LPTSTR equivalent for Visual Basic

9. C++ to VB6 again

10. VBA on again off again

11. Printer object again and again

12. Again and Again, Bold text in a Listview

 

 
Powered by phpBB® Forum Software