初学openGl,照着书敲了个程序,编译通过,能显示三角形,但是关闭时会提示0x00402e64指令引用的“0xddddde”内存,
不能read
void CMy123View::OnDraw(CDC* pDC)
{
CMy123Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
mydraw();
    SwapBuffers(wglGetCurrentDC());
}
void CMy123View::mydraw()
{
glClearColor(1.0f,1.0f,1.0f,1.0f);//setup backcolor
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
    DrawTris();
    glFinish();
}
BOOL CMy123View::mypix(.....)
void CMy123View::myfirst()
{
PIXELFORMATDESCRIPTOR pfd;
    int n;
HGLRC hrc;
m_pDC=new CClientDC(this);
ASSERT(m_pDC!=NULL);
if(!mypix()) return;
n=::GetPixelFormat(m_pDC->GetSafeHdc());
::DescribePixelFormat(m_pDC->GetSafeHdc(),n,sizeof(pfd),&pfd);
hrc=wglCreateContext(m_pDC->GetSafeHdc());
wglMakeCurrent(m_pDC->GetSafeHdc(),hrc);

}
void CMy123View::OnDestroy() 
{
CView::OnDestroy();

// TODO: Add your message handler code here
HGLRC hrc;
hrc=::wglGetCurrentContext();
::wglMakeCurrent(NULL,NULL);
if(hrc)
delete m_pDC;
::wglDeleteContext(hrc);
if(m_pDC)
delete m_pDC;//调试问题出在这句?、
}
void CMy123View::DrawTris()
{ glColor3f( 1.0, 0.0, 0.0 );
      glBegin(GL_LINE_LOOP);
  glVertex3f(0.15f,0.25f,0.05);
  glVertex3f(0.18f,0.05f,0.45);
         glVertex3f(0.86f,0.08f,0.89);
  glEnd();}
省略了一些初始化程序段,错误提示为
Relinking "D:\123\Debug\123.exe" with code changes made during debugging...
LINK : fatal error LNK1168: cannot open D:\123\Debug\123.exe for writing
执行 C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe 时出错.
D:\123\Debug\123.exe - 1 error(s), 0 warning(s)
请各位大虾,帮我看看呀。