<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">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:</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">vtkMFC.lib(vtkMFC.dll) : error LNK2001: unresolved external symbol <A href="mailto:___delayLoadHelper@8">___delayLoadHelper@8</A><BR>Debug/VTKStart.exe : fatal error LNK1120: 1 unresolved externals<BR>Error executing link.exe.<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">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?</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">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?</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">Thank you again for your response.</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,</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Han</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- 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><BR>
<DIV><SPAN class=gmail_quote>On 10/29/06, <B class=gmail_sendername>echinococcus Multilocularis</B> <<A href="mailto:lintworm2@yahoo.co.uk" target=_blank rel=nofollow>lintworm2@yahoo.co.uk</A>> wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman,new york,times,serif">
<DIV>
<DIV>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> </DIV></DIV></DIV></DIV><BR>_______________________________________________<BR>This
is the private VTK discussion list.<BR>Please keep messages on-topic. Check the FAQ at: <A href="http://www.vtk.org/Wiki/VTK_FAQ" target=_blank rel=nofollow>http://www.vtk.org/Wiki/VTK_FAQ</A><BR>Follow this link to subscribe/unsubscribe:<BR><A href="http://www.vtk.org/mailman/listinfo/vtkusers" target=_blank rel=nofollow>http://www.vtk.org/mailman/listinfo/vtkusers </A><BR><BR><BR></BLOCKQUOTE></DIV><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR></DIV></div><br>Send instant messages to your online friends http://uk.messenger.yahoo.com </body></html>