VS2010 Win32应用程序写MFC,编译出错
我是现在VC++6.0里写的,一个很简单的程序 就是一开始全屏白,再全屏黑,再绘制三个白色的圆。是用来图像识别时的边缘检测和矩阵转换的(这个跟本程序本身没关系····)
还有一些功能需要用到openCV,又不像下一个老版本的openCV去配合VC++6.0就把程序挪到VS2010里去执行,可是编译报错很恶心,头文件都编不过去···谁能帮忙解答一下吗。
下面
1#头文件
2#源文件
3#报错 内容
#ifndef _FULLSCREEN #define _FULLSCREEN #include <AFXWIN.H> class CFullScrnApp:public CWinApp { private: protected: public: virtual BOOL InitInstance(); }; class CFullScrnWindow:public CFrameWnd { public: CFullScrnWindow(); afx_msg void OnNcPaint(); afx_msg void OnTimer(UINT); DECLARE_MESSAGE_MAP() }; #endif
//***************** // Full Screen Test //***************** #include "FullScreenApp.h" #define GAP 1000 #define ID_TIMER1 1 #define ID_TIMER2 2 CFullScrnApp FullScrnApp; int nFullWidth=GetSystemMetrics(SM_CXSCREEN); int nFullHeight=GetSystemMetrics(SM_CYSCREEN); BEGIN_MESSAGE_MAP(CFullScrnWindow,CFrameWnd) ON_WM_NCPAINT() ON_WM_TIMER() END_MESSAGE_MAP() BOOL CFullScrnApp::InitInstance() { m_pMainWnd=new CFullScrnWindow(); m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED); m_pMainWnd->UpdateWindow(); return TRUE; } CFullScrnWindow::CFullScrnWindow() { Create(NULL,"FullScreenTest",WS_OVERLAPPEDWINDOW,CRect(0,0,nFullWidth,nFullHeight)); SetWindowLong(this->m_hWnd,GWL_STYLE,255); SetTimer(ID_TIMER1,GAP,NULL); SetTimer(ID_TIMER2,GAP*2,NULL); } void CFullScrnWindow::OnNcPaint() { CWindowDC dc(this); dc.FillSolidRect(0,0,nFullWidth,nFullHeight,RGB(255,255,255)); } void CFullScrnWindow::OnTimer(UINT nIDEvent) { CWindowDC dc(this); if (nIDEvent==1) { dc.FillSolidRect(0,0,nFullWidth,nFullHeight,RGB(0,0,0)); KillTimer(ID_TIMER1); } else if(nIDEvent==2) { CBrush cBrush; CWindowDC dc(this); cBrush.CreateSolidBrush(RGB(255,255,255)); dc.Ellipse(10,0,80,70); dc.Ellipse(1277,10,1347,80); dc.Ellipse(752,615,822,685); KillTimer(ID_TIMER2); } }