Hi!
I test the article's example, dll use /MTd exe use /MLd but no access
violation occur, but I indeed meet such things.
according to reason in the aticle:
Most classes in the Standard C++ Libraries use static data members directly
or indirectly. Since these classes are generated through template
instantiation, each executable image (usually with DLL or EXE file name
extensions) will contain its own copy of the static data member for a given
class. When a method of the class that requires the static data member is
executed, it uses the static data member in the executable image in which
the method code resides. Since the static data members in the executable
images are not in sync, this action could result in an access violation or
data may appear to be lost or corrupted.
seems reasonable, so I'am still confused
<ab******@googlemail.com>
??????:11*********************@l77g2000hsb.googleg roups.com...
On Mar 19, 9:23 am, "mos" <mmosqu...@163.comwrote:
>Hi!
According the article:
You may experience an access violation when you access an STL object
through a pointer or reference in a different DLL or
EXEhttp://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b172396
But I wonder which stl object can access and which not, I have used
std::iostream and std::string this way and seems ok, I know std::map can
not, is there any more? The question confused me much.
Best regard
mos.
I'm using the stl between dll's and exe's all the time. You have to
watch out which runtime library you link. In Visual Studio you have to
check it in "Code Generation". It must be one of the DLL versions.