Is it possible to pass a Delphi stream (TStream descendant) to a DLL written in c/c++? DLL will be written in Microsoft c/c++. If that is not possible, how about if we use C++ Builder to create the DLL? Alternatively, are there any Stream (FIFO) classes which can be shared between Microsoft C/C++ and Delphi?
Thanks!
You can do this using IStream and TStreamAdapter. Here’s a quick example (tested in D2007 and XE2):
Just in case, if you need to go the other way (receiving an
IStreamfrom C/C++), you can use TOleStream to get from thatIStreamto a DelphiTStream.