rt
一个简单的MFC程序
#include "afxwin.h"
class CMyApp:public CWinApp
{
public:
virtual BOOL InitInstance();
//rewrite the initinstance function in myapp
};
class CMainWnd:public CFrameWnd
{
protected:
afx_msg void Function1(WPARAM wParam,LPARAM lParam)
//function to deal with the information
{
MessageBox("左键单击");
}
afx_msg void Function1(WPARAM wParam,LPARAM lParam)
//function to deal with the information
{
MessageBox("右键单击");
}
DECLARE_MESSAGE_MAP();
};
BEGIN_MESSAGE_MAP(CMainWnd,CFrameWnd);
ON_MESSAGE(WM_LBUTTONDOWN,Function1);
ON_MESSAGE(WM_LBUTTONDOWN,Function1);
END_MESSAGE_MAP();
BOOL CMyApp::InitInstance()
{
CFrameWnd*p=new CFrameWnd; //produce the win class
p->Create(0,"workspace"); //create the window
p->ShowWindow(SW_SHOWMAXIMIZED);//show the window
p->UpdateWindow();
AfxGetApp()->m_pMainWnd=p; //focus on the mainwindow
return TRUE;
}
CMyApp myapp;
编译的时候出现的错误是
fatal error C1010: unexpected end of file while looking for precompiled header directive
蝈蝈们帮忙给找找原因吧