[Lazarus] Reading std::ostream from dll

Leonardo M. Ramé l.rame at griensu.com
Tue Nov 23 21:18:38 CET 2010


Hi, I'm working with a dll/so created with C++, that has a function which
fills an std::ostream, and I need to read it from a FreePascal app using
a buffer or TStream.

The C++ method is similar to this:

void myClass::getOutputData(ostream &out);

I wrapped it to be readable from FPC as this:
...
extern "C"{
  void getMyOutputData(void * myInstance, void * &stream){
    myClass * lInstance = (myClass *)myInstance;
    lInstance->getOutputData(stream);
  }
}
...

Is there a way to read std::ostream from FPC?

thanks in advance,
-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com




More information about the Lazarus mailing list