You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Ross MacGregor <Ro...@orbitaltech.com> on 2000/03/29 18:27:45 UTC

Xerces & MFC DLL don't mix?

I am using Xerces-C 1.1.0 d15 for Win32.

I have read the thread on the memory leaks caused by reloading the DLL and
want to know if this is the same problem I have run into.

I seems that Xerces does not like to link MFC as a dynamically linked
library.
The following small program produces a whole page of memory leaks when it is
shut down. If I link MFC as a statically linked library there are no
problems.

main()
{
	CString str;

	XMLPlatformUtils::Initialize();

	return 0;
}

Additionally I noticed another strange thing using the statically linked
MFC. I cannot delete the strings returned from DOMString::transcode. The
code asserts if try to delete it, plus when I shut down the program, no
memory leaks are detected.

I know I am supposed to delete these strings, so what's going on here? I
heard that this might happen if you reload the library.  I am not doing this
explicitly, is this something that is being done behind the scenes.  Could
someone explain this?

    -ross 

RE: Xerces & MFC DLL don't mix?

Posted by Linda Derezinski <li...@interfacecontrol.com>.
I ran into a similar problem with our code.  The problem that I had was that
all of the dll's had to be converted to use the dynamic multi-threaded dll,
not just the exe.  Once I did that, we seem to be running fine.


Linda Derezinski
Interface & Control Systems

 -----Original Message-----
From: 	Ross MacGregor [mailto:RossM@orbitaltech.com]
Sent:	Wednesday, March 29, 2000 11:28 AM
To:	xerces-dev@xml.apache.org
Subject:	Xerces & MFC DLL don't mix?


I am using Xerces-C 1.1.0 d15 for Win32.

I have read the thread on the memory leaks caused by reloading the DLL and
want to know if this is the same problem I have run into.

I seems that Xerces does not like to link MFC as a dynamically linked
library.
The following small program produces a whole page of memory leaks when it is
shut down. If I link MFC as a statically linked library there are no
problems.

main()
{
	CString str;

	XMLPlatformUtils::Initialize();

	return 0;
}

Additionally I noticed another strange thing using the statically linked
MFC. I cannot delete the strings returned from DOMString::transcode. The
code asserts if try to delete it, plus when I shut down the program, no
memory leaks are detected.

I know I am supposed to delete these strings, so what's going on here? I
heard that this might happen if you reload the library.  I am not doing this
explicitly, is this something that is being done behind the scenes.  Could
someone explain this?

    -ross