一个非常简单地代码,编译总出错
运动健将 2005-10-11 06:17:46 #include <afxwin.h>
class CWApp : public CWinApp
{
public:
virtual bool InitInstance();
};
class CFWnd : public CFrameWnd
{
public:
CFWnd();
};
CWApp theApp;
bool CWApp::InitInstance()
{
m_pMainWnd=new CFWnd();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return true;
}
CFWnd::CFWnd()
{
Create(NULL,"HELLO MFC",WS_OVERLAPPEDWINDOW,rectDefault,NULL,NULL);
}
编译环境VC60
出错提示: error C2555: 'CWApp::InitInstance' : overriding virtual function differs from 'CWinApp::InitInstance' only by return type or calling convention
c:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(4031) : see declaration of 'CWinApp'