<DIV>
<DIV>Hello,</DIV>
<DIV>I have updated my vtkWin32OpenGLRenderWindow (lines where not the same at all). My app doesn't crash anymore but I have a VTK error instead :</DIV>
<DIV>&nbsp;</DIV>
<DIV>wglMakeCurrent failed in MakeCurrent(), error: Invalid descriptor</DIV>
<DIV>wglMakeCurrent failed in Clean(), error: 6</DIV>
<DIV>&nbsp;</DIV>
<DIV>Here is the location :</DIV>
<DIV>&nbsp;</DIV>
<DIV>void vtkWin32OpenGLRenderWindow::MakeCurrent()<BR>{<BR>&nbsp; // Try to avoid doing anything (for performance).<BR>&nbsp; HGLRC current = wglGetCurrentContext();<BR>&nbsp; if (this-&gt;ContextId != current)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; if(this-&gt;IsPicking &amp;&amp; current)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkErrorMacro("Attempting to call MakeCurrent for a different window"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " than the one doing the picking, this can causes crashes"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " and/or bad pick results");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (wglMakeCurrent(this-&gt;DeviceContext, this-&gt;ContextId) !=
 TRUE)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbs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bsp; &lt;&lt; (LPCTSTR)lpMsgBuf);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ::LocalFree( lpMsgBuf );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR>}<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>called in vtkWin32OpenGLRenderWindow::Clean()</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; if (wglMakeCurrent(NULL, NULL) != TRUE)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkErrorMacro("wglMakeCurrent failed in Clean(), error: " &lt;&lt; GetLastError());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR></DIV><BR><BR><B><I>Mathieu Malaterre &lt;mathieu.malaterre@kitware.com&gt;</I></B> wrote:
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Aurélien,<BR><BR>You shouldn't be doing something particular for Windows. I recently <BR>commited a patch for that -or I believe so-. Could you do me a favor, <BR>could you please try it instead of the<BR><BR>'self.renderer.GetProps().RemoveAllItems()'<BR><BR>Go to that web page, it works just like a patch :<BR><BR>http://vtk.org/cgi-bin/cvsweb.cgi/VTK/Rendering/vtkWin32OpenGLRenderWindow.cxx.diff?r1=1.121&amp;r2=1.122<BR><BR>And just apply the same modification to your local VTK build tree. (you <BR>don't need a particular revision of vtkWin32OpenGLRenderWindow.cxx).<BR><BR>Thanks a bunch<BR>Mathieu<BR><BR></BLOCKQUOTE></DIV><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>