<DIV>Hello,</DIV>
<DIV>Yes I have 2 render windows, but during my test I have not initialized the second (empty window).</DIV>
<DIV>So I will keep the solution of cleaning all object.</DIV>
<DIV>For information, here is the code I use :</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; renderers = self.wxVTKRenWin1.GetRenderWindow().GetRenderers()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; numRenderers = renderers.GetNumberOfItems()</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; renderers.InitTraversal()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i in range(0,numRenderers):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; renderer = renderers.GetNextItem()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; renderer.RemoveAllProps()<BR><BR><BR><B><I>Mathieu Malaterre &lt;mathieu.malaterre@kitware.com&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Aurélien<BR><BR>Do you use two render windows ? Anyway you should use the other <BR>solution while I try to fix this problem. Thanks a lot this was very <BR>usefull.<BR><BR>Mathieu<BR><BR>REGAT-BARREL Aurélien wrote:<BR>&gt; Hello,<BR>&gt; I have updated my vtkWin32OpenGLRenderWindow (lines where not the same <BR>&gt; at all). My app doesn't crash anymore but I have a VTK error instead :<BR>&gt; <BR>&gt; wglMakeCurrent failed in MakeCurrent(), error: Invalid descriptor<BR>&gt; wglMakeCurrent failed in Clean(), error: 6<BR>&gt; <BR>&gt; Here is the location :<BR>&gt; <BR>&gt; void vtkWin32OpenGLRenderWindow::MakeCurrent()<BR>&gt; {<BR>&gt; // Try to avoid doing anything (for performance).<BR>&gt; HGLRC current = wglGetCurrentContext();<BR>&gt; if (this-&gt;ContextId != current)<BR>&gt; {<BR>&gt; if(this-&gt;IsPicking &amp;&amp; current)<BR>&gt; {<BR>&gt; vtkErrorMacro("Attempting to
 call MakeCurrent for a different window"<BR>&gt; " than the one doing the picking, this can causes <BR>&gt; crashes"<BR>&gt; " and/or bad pick results");<BR>&gt; }<BR>&gt; else<BR>&gt; {<BR>&gt; if (wglMakeCurrent(this-&gt;DeviceContext, this-&gt;ContextId) != TRUE)<BR>&gt; {<BR>&gt; LPVOID lpMsgBuf;<BR>&gt; ::FormatMessage(<BR>&gt; FORMAT_MESSAGE_ALLOCATE_BUFFER |<BR>&gt; FORMAT_MESSAGE_FROM_SYSTEM |<BR>&gt; FORMAT_MESSAGE_IGNORE_INSERTS,<BR>&gt; NULL,<BR>&gt; GetLastError(),<BR>&gt; MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language<BR>&gt; (LPTSTR) &amp;lpMsgBuf,<BR>&gt; 0,<BR>&gt; NULL<BR>&gt; );<BR>&gt; vtkErrorMacro("wglMakeCurrent failed in MakeCurrent(), error: "<BR>&gt; &lt;&lt; (LPCTSTR)lpMsgBuf);<BR>&gt; ::LocalFree( lpMsgBuf );<BR>&gt; }<BR>&gt; }<BR>&gt; }<BR>&gt; }<BR>&gt; <BR>&gt; called in vtkWin32OpenGLRenderWindow::Clean()<BR>&gt; <BR>&gt; if (wglMakeCurrent(NULL, NULL) != TRUE)<BR>&gt; {<BR>&gt; vtkErrorMacro("wglMakeCurrent failed in Clean(), error: "
 &lt;&lt; <BR>&gt; GetLastError());<BR>&gt; }<BR>&gt; <BR>&gt; <BR>&gt; */Mathieu Malaterre <MATHIEU.MALATERRE@KITWARE.COM>/* wrote:<BR>&gt; <BR>&gt; Aurélien,<BR>&gt; <BR>&gt; You shouldn't be doing something particular for Windows. I recently<BR>&gt; commited a patch for that -or I believe so-. Could you do me a favor,<BR>&gt; could you please try it instead of the<BR>&gt; <BR>&gt; 'self.renderer.GetProps().RemoveAllItems()'<BR>&gt; <BR>&gt; Go to that web page, it works just like a patch :<BR>&gt; <BR>&gt; http://vtk.org/cgi-bin/cvsweb.cgi/VTK/Rendering/vtkWin32OpenGLRenderWindow.cxx.diff?r1=1.121&amp;r2=1.122<BR>&gt; <BR>&gt; And just apply the same modification to your local VTK build tree. (you<BR>&gt; don't need a particular revision of vtkWin32OpenGLRenderWindow.cxx).<BR>&gt; <BR>&gt; Thanks a bunch<BR>&gt; Mathieu<BR>&gt; <BR>&gt; <BR>&gt; ------------------------------------------------------------------------<BR>&gt; Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en
 français !<BR>&gt; Testez le nouveau Yahoo! Mail <HTTP: fr.mail.yahoo.com><BR><BR><BR><BR><BR>_______________________________________________<BR>This is the private VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at: <HTTP: vtkfaq cgi-bin public.kitware.com><BR>Follow this link to subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers</BLOCKQUOTE><p><br><hr size=1><font face=arial size=-1>Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !<br>
<a href=http://fr.mail.yahoo.com>Testez le nouveau Yahoo! Mail</a></font>