关于全局变量出错的问题
我是完全按照孙鑫的教程做的,不知道哪里设置的问题。老报错,说我全局变量有问题。请高手指点一下!菜鸟先谢谢了。
void CDrawView::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
HDC hdc;
hdc=::GetDc(m_hwnd);
MoveToEx(hdc,m_ptOrigin.x,m_ptOrigin.y,NULL);
LineTo(hdc,point.x,point.y);
::ReleaseDc;
CView::OnLButtonUp(nFlags, point);
}
一下为报错:
E:\my file\mfc\Draw\DrawView.cpp(117) : error C2039: 'GetDc' : is not a member of '`global namespace''
E:\my file\mfc\Draw\DrawView.cpp(117) : error C2065: 'GetDc' : undeclared identifier
E:\my file\mfc\Draw\DrawView.cpp(117) : error C2065: 'm_hwnd' : undeclared identifier
E:\my file\mfc\Draw\DrawView.cpp(117) : error C2440: '=' : cannot convert from 'int' to 'struct HDC__ *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
E:\my file\mfc\Draw\DrawView.cpp(120) : error C2039: 'ReleaseDc' : is not a member of '`global namespace''
E:\my file\mfc\Draw\DrawView.cpp(120) : error C2065: 'ReleaseDc' : undeclared identifier