添加WM_DESTROY的消息处理函数Ondestroy( ),使之如下所示:
void CGLSample1View::OnDestroy()
{
if(wglGetCurrentContext()!=NULL)
{ // make the rendering context not current
wglMakeCurrent(NULL, NULL) ;
}
if (m_hGLContext!=NULL)
{ wglDeleteContext(m_hGLContext);
m_hGLContext = NULL;
}
// Now the associated DC can be released.
CView::OnDestroy();
}
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/










