Returning strings from C DLL
I've become responsible for some old code which returns a newly allocated string to a VB app. We just switched over from Visual C++ 2.1 to Visual C++ 4.2. Apparently 4.2 no longer supports automatic conversion of strings, so we cannot allocate a BSTR properly and return it to the VB App.
My question is, what is the correct way to allocate and return a string to a VB app from a DLL, given a char*?
Cheers beers,
Ant.
Re: Returning strings from C DLL
you need to call SysAllocString as documented in
MSDN article Q196976