Hey there,
I hope someone out there is alot smarter than I am :) .
I have this strange problem when accessing a static library written in VS2005 from a VS2003 MFC-project. Code is in native C++.
I use static binding in my VS2003-project.
I have no trouble accessing the lib, and executing the methods, but when I pass an std::string by ref (or an std::vector) in VS2003, it seems that the memory-location in VS2005 is shifted by 4 bytes, resulting in a <removed ptr=""> and a crash.
I call a method "Foo(std::string& arg_szError);"
In VS2003, the address of my string is 0x0013F4C0, but when I debug Foo in VS2005, the address of my string suddenly became 0x0013F4C4, with the known result.
The funny thing is that it actually worked for a little while, but I had to move some projects in my solution to different directories and since then, I get this very annoying problem.
I think something (most probably me :( ) messed up the code-generation and/or linking options.
Here are some options which, I think, could be useful.
VS2003:
General options: application (exe), use MFC in shared dll, not using ATL, MBCS
C/C++: Multi-threaded Debug DLL, default struct member alignment, __cdelc
Linker: not ignoring default libraries
VS2005:
General options: static library, use standard windows libraries, dynamic link to ATL, MBCS
C/C++: Multi-threaded Debug, default struct member alignment, __cdelc
The main reason for using 2 different IDE's is that I'm using a template-library to do some matrix-calculations which only ships for VS2005 or higher, and my main-app comes with 3rd party libs written for VS2003 (I tried to upgrade, but it failed due to some MFC-references in the libs, which of course don't belong there).
Thanks in advance for trying to help me out of this!