<html>
VTK libraries can be either DLL's or static libraries on windows. <br>
However, I don't see what that has to do with which MFC library you<br>
should be using.&nbsp;&nbsp; It sounds like the memory leak is in MFC
and<br>
has nothing to do with VTK.&nbsp;&nbsp; If you made a test case without
VTK but<br>
used the MFC dll would it still leak?&nbsp; (I would make sure the test
case<br>
used OpenGL, if it did not leak without it)<br>
<br>
-Bill<br>
<br>
<br>
At 04:31 PM 2/28/2002 +1100, Andrew J. P. Maclean wrote:<br>
<br>
<blockquote type=cite class=cite cite><font face="arial" size=2>When
building MFC applications I have been getting memory leaks when the
program exits. <br>
</font><br>
<font face="arial" size=2>&nbsp;<br>
</font><br>
<font face="arial" size=2>The cause of these memory leaks relates to
using the MFC library as a shared DLL. So to avoid memory leaks you must
use the MFC library as a statically linked library. However, the MCF App
Wizard, by default, selects using the library as a shared DLL, so when
creating a project make sure to click on the As a statically linked
library radio button in the IDE. When building an SDI or a MDI
application this is Step 5 in the MFC App Wizard and for a Dialog
application, this is Step 3.<br>
</font><br>
<font face="arial" size=2>&nbsp;<br>
</font><br>
<font face="arial" size=2>Since the vtk libraries and DLLs are built as
static libraries so we <b><u>should</u></b> be using the MFC library as a
statically linked library!<br>
</font><br>
<font face="arial" size=2>&nbsp;<br>
</font><br>
<font face="arial" size=2>I hope this helps those who have noticed the
leaks in the past.<br>
</font><br>
<font face="arial" size=2>Perhaps this could become a FAQ entry.<br>
</font><br>
<font face="arial" size=2>&nbsp;<br>
</font><br>
<font face="arial" size=2>Sometime in the near future, I promise that I
will amend the samples that I created recently so that the MFC library is
linked in as a statically linked library. <br>
</font><br>
<font face="arial" size=2>&nbsp;<br>
</font><br>
<font face="arial" size=2>Andrew<br>
</font><br>
<font face="arial" size=2>&nbsp;<br>
</font><br>
<h3><font face="verdana" size=2 color="#330099"><b>___________________________________________<br>
</b></font>Andrew J. P. Maclean</h3><br>
<br>
<font face="verdana" size=2>Postal:<br>
</font><br>
<font face="verdana" size=2>Australian Centre for Field Robotics<br>
The Rose Street Building J04<br>
The University of Sydney&nbsp; 2006&nbsp; NSW<br>
AUSTRALIA<br>
</font><br>
<font face="verdana" size=2>Room:<br>
</font><br>
<font face="verdana" size=2>106<br>
</font><br>
<font face="verdana" size=2>Phone:<br>
</font><br>
<font face="verdana" size=2>+61 2 9351 3283<br>
</font><br>
<font face="verdana" size=2>Fax:<br>
</font><br>
<font face="verdana" size=2>+61 2 9351 7474<br>
</font><br>
<font face="verdana" size=2>&nbsp;<br>
</font><br>
<font face="verdana" size=2><a href="http://www.acfr.usyd.edu.au/">http://www.acfr.usyd.edu.au/</a><br>
</font><br>
<font face="verdana" size=2 color="#330099"><b>___________________________________________<br>
</b></font><br>
<font face="Times New Roman, Times">&nbsp;</font></blockquote></html>