error C2653: 'CMy01App' : is not a class or namespace name
#include<AfxWin.h>
class CMy01App :: public CWinApp
{
public:
virtual BOOL InitInstance();
};
class CMyWindow :: public CFrameWnd
{
public:
CMyWindow();
protected:
afx_msg void OnPaint ();
DECLARE_MESSAGE_MAP();
};
BOOL CMy01App::InitInstance()
{
m_pMainWnd= new CMyWindow;
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}
BEGIN_MESSAGE_MAP(CMyWindow,CFrameWnd)
ON_WM_PAINT()
END_MESSAGE_MAP()
CMyWindow::CMyWindow()
{
Create(NULL,_T("The Hello Application"));
}
void CMainWindow::OnPaint()
{
CPaintDC dc(this);
dc.MoveTo(10,20);
dc.LineTo(100,200);
}
想知道为什么会这样:error C2653: 'CMy01App' : is not a class or namespace name