<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Thanks a lot! That did the trick! Also thanks again to David Cole!</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">sincerely, Han<BR><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: ÀÌâ¿ø <bosscq@nexgeo.com><BR>To: echinococcus Multilocularis <lintworm2@yahoo.co.uk><BR>Cc: vtkusers@vtk.org<BR>Sent: Monday, 30 October, 2006 7:27:59 AM<BR>Subject: RE: [vtkusers] Memory leaks....<BR><BR>
<STYLE>
<!--
_filtered {font-family:Batang;
panose-1:2 3 6 0 0 1 1 1 1 1;}
_filtered {font-family:Gulim;
panose-1:2 11 6 0 0 1 1 1 1 1;}
_filtered {font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
_filtered {font-family:Gulim;
panose-1:2 11 6 0 0 1 1 1 1 1;}
_filtered {font-family:Batang;
panose-1:2 3 6 0 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
text-decoration:underline;}
span.EmailStyle18
        {
font-family:Gulim;
color:navy;}
_filtered {
margin:99.25pt 3.0cm 3.0cm 3.0cm;}
div.Section1
        {}
-->
</STYLE>
<DIV class=Section1>
<P class=MsoNormal><FONT face=±¼¸² color=navy size=2><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Gulim">Hello</SPAN></FONT></P>
<P class=MsoNormal><FONT face=±¼¸² color=navy size=2><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Gulim"> </SPAN></FONT></P>
<P class=MsoNormal><FONT face=±¼¸² color=navy size=2><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Gulim">You have to delay load vtk dlls too. (such as vtkcommon, vtkrendering, etc)</SPAN></FONT></P>
<P class=MsoNormal><FONT face=±¼¸² color=navy size=2><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Gulim"> </SPAN></FONT></P>
<P class=MsoNormal><FONT face=±¼¸² color=navy size=2><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Gulim">regards</SPAN></FONT></P>
<P class=MsoNormal><FONT face=±¼¸² color=navy size=2><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Gulim"> </SPAN></FONT></P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN lang=EN-US style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT face=Tahoma size=2><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> vtkusers-bounces+bosscq=nexgeo.com@vtk.org [mailto:vtkusers-bounces+bosscq=nexgeo.com@vtk.org] <B><SPAN style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>echinococcus Multilocularis<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Monday, October 30, 2006 6:37 AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> David Cole<BR><B><SPAN style="FONT-WEIGHT: bold">Cc:</SPAN></B> vtkusers@vtk.org<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [vtkusers] Memory leaks....</SPAN></FONT><SPAN lang=EN-US></SPAN></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt"> </SPAN></FONT></P>
<DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt">Thank you for your response. I did what you suggested, to be precise, the second option. I added the linker option /DELAYLOAD:vtkMFC.dll. (I use vtkRendering.dll as well, should this one be delayed as well?) However, the result was now that there was an unresolved symbol:</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt"> </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt">vtkMFC.lib(vtkMFC.dll) : error LNK2001: unresolved external symbol <A href="mailto:___delayLoadHelper@8" target=_blank rel=nofollow>___delayLoadHelper@8</A><BR>Debug/VTKStart.exe : fatal error LNK1120: 1 unresolved externals<BR>Error executing link.exe.</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt">After a little googling, i noticed i should add the lib: Delayimp.lib. So i added the lib, and the compilation went fine again. However, now, the memory leaks returned. Is there something else wrong, or am i forgetting something?</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt"> </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt">Secondly, if i were to go the other path, which files do I have to download? Only the files that are in the GUISupport/MFC/ or others as well?</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt"> </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt">Thank you again for your response.</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt"> </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt">Sincerely,</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt">Han</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt">----- Original Message ----<BR>From: David Cole <david.cole@kitware.com><BR>To: echinococcus Multilocularis <lintworm2@yahoo.co.uk><BR>Cc: vtkusers@vtk.org<BR>Sent: Sunday, 29 October, 2006 5:56:43 PM<BR>Subject: Re: [vtkusers] Memory leaks....<BR><BR>The problem is that VTK dlls are loaded before the MFC dll, and at shutdown time, the MFC dll is unloaded before the VTK dlls... And when the MFC dll unloads, it does a memory leak check and incorrectly reports that all the VTK objects still left are leaks. <BR><BR>You can overcome this by updating VTK to the CVS version and rebuilding VTK with VTK_USE_GUISUPPORT and VTK_USE_MFC turned on. I recently added flags to the CMakeLists to eliminate these false memory leak reports. <BR><BR>Alternatively, you can use the /DELAYLOAD linker flag to force the VTK dlls to be loaded after the MFC dll
and then they will also be unloaded prior to the MFC dll. Then any leak reports that you see will be for real... (This is what I added in CVS VTK to fix the problem.) <BR><BR>HTH,<BR>David<BR><BR></SPAN></FONT></P>
<DIV>
<P class=MsoNormal><SPAN class=gmailquote><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt">On 10/29/06, <B><SPAN style="FONT-WEIGHT: bold">echinococcus Multilocularis</SPAN></B> <<A href="mailto:lintworm2@yahoo.co.uk" target=_blank rel=nofollow>lintworm2@yahoo.co.uk</A>> wrote:</SPAN></FONT></SPAN><SPAN lang=EN-US> </SPAN></P>
<DIV>
<DIV>
<DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt">Hello all,<BR><BR>I finally got my M$ VC project working, using vtkMFCWindow. In this program i read some geometrical data from disk using my own readerfunction. I then display it using vtkMFCWindow. That all works fine, until i close the program and clean up the memory. At the end of program i get a message that memory leaks are detected. The problem is, that i really have no clue where they are from. When i look at the data dumped by VC, i find references to all kinds of objects i never have used. Can anybody tell me what i am doing wrong, or give me any other clues? I have build my program mostly using the examples given for vtkMFCWindow, however, also these examples give me the same problems. <BR><BR>Thanking in advance,<BR><BR>Han<BR><BR>Send instant messages to your online friends <A href="http://uk.messenger.yahoo.com/" target=_blank
rel=nofollow>http://uk.messenger.yahoo.com</A> </SPAN></FONT></P></DIV></DIV></DIV></DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><FONT face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt"><BR></SPAN></FONT></P></DIV></DIV></DIV></DIV></DIV></div><br>Send instant messages to your online friends http://uk.messenger.yahoo.com </body></html>