Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Passing strings to and from C++ DLL without using MFC


Message #1 by heinz.prochaska@a... on Sun, 29 Sep 2002 16:00:29
The String data type corresponds to the BSTR C++ type (in fact they
are the same thing, it is a COM data type). Keep in mind that dealing
with strings in C++ is not as easy as in VB. I suggest you to use 
ATL library to build your DLL, because it is much convenient,
unless you are already doing so.
There is plenty of documentation on using BSTR in the MDSN.

Marco
 
> Hi,

> I have to create a C++ DLL which I want to call from VB 6.0. I have got 
i> t  to work fine with long integer values but I also need to pass 
strings 
t> o the DLL and get strings back from the DLL. I don't want to use MFC in 
t> he DLL so I think I have to use string in the DLL. Has anybody a sample 
o> f passing strings to a C++ DLL using string?

> Many thanks for help
R> egards
H> einz

  Return to Index