I've got a fair amount of code that uses the XalanDOMString::c_str() to create std::string objects, and all linking is with runtime DLLs.  I haven't seen a crash.  What are you doing, exactly?  You can't actually push a char[] array into a vector unless you've got it wrapped in a class that has copy and destruct semantics.

Ryan Sawatzky <[EMAIL PROTECTED]> wrote:
Hi,

We are trying to move our code over to Windows. In our code we have a
function that converts a XalanDOMString into a old C-Style null
terminated character array. When we try to run through this function,
the program usually crashes on the fourth or fifth time it is called.
The access violation occurrs on the return statement of the function.
In the stack trace that MSVC++ prints out it is clear that the access
violation is occurring in std::vector::~vector() deconstructor.

I searched the archives for this group and found several references to a
similar problem that was apparently solved by changing the linking
options for the project. So I changed the linking to Multithreaded
Debug DLL, and the problem still occurs. I have tried all three of the
Multithreaded linking options and none of them change the behavior.
Does anyone know why this program is crashing? In case it helps, here
is the linkage string that is in the project settings->C++->Code
Generation window.

/nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D
"_MBCS" /FR"Debug/" /Fp"Debug/tst.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD
/GZ /c

Notice the /MDd argument to specify Multithreaded Debug DLL

Thanks for any help,
Ryan

Reply via email to