c++ - Bad pointer or link issue when creating wstring from vc6 dll -
I got a DLL using VC6 and using wstring
, and I use it In a VC9 project I am trying to do this DLL has a high level class named wstring
, UtfString
.
Everything was properly imported into my project, but when I call:
std :: wstring test; UtfString uTest (test);
This will not be a link, even if the function prototype is in Lib ...
The other issuer is that when creating a new UtfString, and debug my app, New pointer & lt; Bad Ptr & gt;
.
I do not believe VC6 wstring
and VC9 wstring
I want to avoid refining the original DL.
It would be great if someone can make things more clear to me, and what is the real reason of the problem to explain to me.
Thank you in advance for your answer, Boris
Do not even try < / P>
String layouts are different
You can not do this
The string class is completely different between VC6 and VC9.
Even if you were able to link, you would most likely be the accident.
There is a union in the VC9 string which is an indicator for 16 byte buffers and string for small string s.t. Size ()> 15 VC9 has a union in whiteness, which is an indicator STT for 8 watcher buffers and string for small wires. is. Size ()> 7
All string buffer space in VC6 is allocated on a pile.
If you pass strings across boundaries, then you have to compile the DLL again.
sorry that will be rebuilt
Comments
Post a Comment