<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>Hello VTK users,<br>I am using VTK 5.0, MS Visual Studio 6.0 and Win Vista.<br>I have the following problem:<br>I want to display a 3D scene in a static control (CStatic) in a dialog box.<br>In the OnInitDialog() of my dialog box class, I insert the code below,<br>but it crashes at the last line, when it's time to delete the renderer window.<br>My question is: am I using SetParentId() correctly?<br>Thank you,<br>Philippe<br>////////////////////////////////////////////////////////////////////////////////////////////////////<br>CStatic *pStatic=(CStatic *)GetDlgItem(IDC_STATIC);<br>&nbsp; vtkConeSource *cone = vtkConeSource::New();<br>&nbsp; cone-&gt;SetHeight( 3.0 );<br>&nbsp; cone-&gt;SetRadius( 1.0 );<br>&nbsp; cone-&gt;SetResolution( 10 );<br>&nbsp; vtkPolyDataMapper *coneMapper =
 vtkPolyDataMapper::New();<br>&nbsp; coneMapper-&gt;SetInputConnection( cone-&gt;GetOutputPort() );<br>&nbsp; vtkActor *coneActor = vtkActor::New();<br>&nbsp; coneActor-&gt;SetMapper( coneMapper );<br>&nbsp;<br>vtkRenderer *ren1= vtkRenderer::New();<br>&nbsp; ren1-&gt;AddActor( coneActor );<br>&nbsp; ren1-&gt;SetBackground( 0.1, 0.2, 0.4 );<br><br>&nbsp; vtkRenderWindow *renWin = vtkRenderWindow::New();<br><br>// Attach the VTK scene to the static control  <br>renWin-&gt;SetParentId(pStatic-&gt;m_hWnd);<br>&nbsp; <br>&nbsp; renWin-&gt;AddRenderer( ren1 );<br>&nbsp; renWin-&gt;SetSize( 300, 300 );<br><br>&nbsp;&nbsp;&nbsp; renWin-&gt;Render();<br>&nbsp; <br>&nbsp; cone-&gt;Delete();<br>&nbsp; coneMapper-&gt;Delete();<br>&nbsp; coneActor-&gt;Delete();<br>&nbsp; ren1-&gt;Delete();<br>&nbsp; renWin-&gt;Delete();<br></div></div><br>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection
 around <br>http://mail.yahoo.com </body></html>