Thread overview
String Streams in Hybrid C/C++ Win16 App
May 11, 2001
Mark Evans
May 11, 2001
Jan Knepper
May 11, 2001
Walter
May 11, 2001
Is it possible to build a Win16 app in C with single object module in C++ that performs stream i/o on string buffers (strstream).  The app is a WINIO app which does have some effects on printf and other calls.  But it should be possible to set up a strstream object in separate .cpp files.

Mark


May 11, 2001
Sure!
It's basically a matter of compiling things the right way and making sure the compiler understand what is C and what is C++ code.

Many times with ancient projects I have just renamed .C files to .CPP and compiled them as C++ programs while the .CPP files basically only contain C coded source.

You might have to put some stuff between
#ifdef __cplusplus
extern "C" {
#endif

// C-stuff

#ifdef __cplusplus
}
#endif

To make sure certain prototypes etc, don't get mangled.

Don't worry, be Kneppie!
Jan



Mark Evans wrote:

> Is it possible to build a Win16 app in C with single object module in C++ that performs stream i/o on string buffers (strstream).  The app is a WINIO app which
> does have some effects on printf and other calls.  But it should be possible to set up a strstream object in separate .cpp files.
>
> Mark

May 11, 2001
I don't see any reason why it shouldn't be possible.

Mark Evans wrote in message <1103_989602360@evans>...
>
>Is it possible to build a Win16 app in C with single object module in C++
that performs stream i/o on string buffers (strstream).  The app is a WINIO
app which
>does have some effects on printf and other calls.  But it should be
possible to set up a strstream object in separate .cpp files.
>
>Mark
>
>