March 29, 2024, 05:11:37 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


C++ Standard Library usage

Started by Allan, November 22, 2008, 04:00:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Allan

The Example that comes with EBasic show how to use the C Standard Library.

Is there a way of using the IOSTREAMS that are in the C++ Standard Library, with EBasic?

Has anyone any examples?

Allan

Ionic Wind Support Team

Nope.  Well it IS possible but not worth the time it would take you converting functions and figuring out the particular compilers name mangling scheme.

You can use static libraries from VC++ 6 for example, but you need to create some wrappers to do it.

Howerver, with that said, someone like Sapero will probably take it on ;)

Paul.
Ionic Wind Support Team

Allan


sapero

Nothing is impossible, just let us know what exactly do you want to use - cin, cout, string?

Allan

I am creating a program DTP which you can see in the following link.

http://www.ionicwind.com/forums/index.php?topic=2920.msg24343#new

I wanted to use IOSTREAMS to save the graphics to a file and to load the graphics back from the file.

Long time ago in the days of 16 bit software I used a program namely Turbo Pascal for Windows ver 1.5 and in that product they gave a sample of a similar program showing the use of IOSTREAMS to do such a task.

It is easier to send the source code so you can see for yourself just what is being done. Namely Registering Classes to Streams to enable saving and loading.

Also I enclosed the EXE so that you can run Streams1.exe then streams2.exe to see the results of the coding.

Though do not go to any hard days with this as I do have a close workaround that is good enough, but not excellent as Streams.

Thank you for having a look!

Allan

sapero

Allan, the source looks like delphi or pascal, and the executables are 16 bit NE. They use bios interrupts (int 21h) to read and write to file, so I think standard file functions are still better. Maybe you need a real stream like IStream to access memory (CreateStreamOnHGlobal) or file (SHCreateStreamOnFile) ?

Allan

Thanks for the info Sapero. I thought they were using the C ++ Std Lib.

Your suggestions look more suitable.

Allan