<FONT color=#0000ff size=2>  <div>I am trying to run an animation using vtk triggered by a Onbutton event.But I experience problems in executing the statement renWin-&gt;Render();It raises the exception (wglMakeCurrent failed).Please suggest what needs to be done to get rid of this error?</div>  <div>Thanks,</div>  <div>Binesh</div>  <div>---------------------------------------------------------------------------------------</div>  <div>void CVtkDlg::OnButton1() </div>  <div>{</div>  <div>AfxBeginThread(Animate,this);</div>  <div>}</div>  <div></div>  <div>UINT CVtkDlg::Animate(LPVOID lp) {</div>  <div>CVtkDlg *dlg=(CVtkDlg *)lp;</div>  <div>dlg-&gt;Animate();</div>  <div>return 0;</div>  <div>}</div>  <div>void CVtkDlg::OnButton2() </div>  <div>{</div>  <div>// TODO: Add your control notification handler code here</div>  <div>running= FALSE;</div>  <div>}</div>  <div></div>  <div></div>  <div>void CVtkDlg::Animate() {</div>  <div></div>  <div>for (int i=0;running &amp;&amp;
 i&lt;this-&gt;no_row;i++)</div>  <div>{</div>  <div>this-&gt;aSplineX-&gt;RemoveAllPoints();</div>  <div>this-&gt;aSplineY-&gt;RemoveAllPoints();</div>  <div>this-&gt;aSplineZ-&gt;RemoveAllPoints();</div>  <div></div>  <div>for (int j=0;running &amp;&amp; j&lt;this-&gt;no_col;j++)</div>  <div>{ </div>  <div>this-&gt;aSplineX-&gt;AddPoint(j,x[j]);</div>  <div>this-&gt;aSplineY-&gt;AddPoint(j,y[i][j]);</div>  <div>this-&gt;aSplineZ-&gt;AddPoint(j,z[i][j]);</div>  <div>this-&gt;inputPoints-&gt;InsertPoint(j,x[j],y[i][j],z[i][j]);</div>  <div>}</div>  <div>this-&gt;Fit();</div>  <div>renWin-&gt;Render();</div>  <div>}</div>  <div>running = FALSE;</div>  <div></div>  <div>}</div>  <div>---------------------------------------------------------------------------------------</div></FONT><p>
        
                <hr size=1><a href="http://us.rd.yahoo.com/mail_us/taglines/postman3/*http://us.rd.yahoo.com/evt=39666/*http://beta.messenger.yahoo.com 
">Yahoo! Messenger with Voice.</a> PC-to-Phone calls for ridiculously low rates.