IonicWind Software

IWBasic => General Questions => Topic started by: Allan on November 22, 2008, 04:00:15 PM

Title: C++ Standard Library usage
Post by: Allan on November 22, 2008, 04:00:15 PM
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
Title: Re: C++ Standard Library usage
Post by: Ionic Wind Support Team on November 23, 2008, 11:15:02 AM
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.
Title: Re: C++ Standard Library usage
Post by: Allan on November 23, 2008, 08:47:48 PM
Thanks for the info.

Allan
Title: Re: C++ Standard Library usage
Post by: sapero on November 24, 2008, 08:53:48 AM
Nothing is impossible, just let us know what exactly do you want to use - cin, cout, string?
Title: Re: C++ Standard Library usage
Post by: Allan on November 24, 2008, 08:04:22 PM
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 (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
Title: Re: C++ Standard Library usage
Post by: sapero on November 25, 2008, 03:29:19 AM
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) ?
Title: Re: C++ Standard Library usage
Post by: Allan on November 25, 2008, 11:28:33 AM
Thanks for the info Sapero. I thought they were using the C ++ Std Lib.

Your suggestions look more suitable.

Allan