Win32 App里面输入以下代码#include <afxwin.h>
class CMyWnd:public CFrameWnd
{
private:
char* ShowText;
public:
afx_msg void OnPaint();
afx_msg void OnLButtonDown();
DECLARE_MESSAGE_MAP()
};BEGIN_MESSAGE_MAP(CMyWnd,CFrameWnd)
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()void CMyWnd::OnPaint()
{
CPaintDC dc(this);
dc.TextOut(20,20,ShowText);
}void CMyWnd::OnLButtonDown()
{
ShowText="Message_mapped Program";
InvalidateRect(Null,true);
}class CMyApp:public CWinApp
{
public:
BOOL InitInstance();
};BOOL CMyApp::InitInstance()
{
CMyWnd* pMainWnd=new CMyWnd;
pMainWnd->Create(0,"MFC");
pMainWnd->ShowWindow(m_nCmdShow);
pMainWnd->UpdateWindow();
m_pMainWnd=pMainWnd;
return true;
}CMyApp MyApp;编译之前选择Project|settings菜单,静态实用MFC类库这是一个书本上的原题,编译之后出现如下错误:Compiling...
main.cpp
E:\MFC\MFC_Eg0205\main.cpp(10) : error C2018: unknown character '0xa3'
E:\MFC\MFC_Eg0205\main.cpp(10) : error C2018: unknown character '0xbb'
E:\MFC\MFC_Eg0205\main.cpp(12) : error C2143: syntax error : missing ';' before '*'
E:\MFC\MFC_Eg0205\main.cpp(12) : error C2501: 'GetMessageMap' : missing storage-class or type specifiers
E:\MFC\MFC_Eg0205\main.cpp(12) : error C2556: 'int *__thiscall CMyWnd::GetMessageMap(void) const' : overloaded function differs only by return type from 'const struct AFX_MSGMAP *__thiscall CMyWnd::GetMessageMap(void) const'
        E:\MFC\MFC_Eg0205\main.cpp(9) : see declaration of 'GetMessageMap'
E:\MFC\MFC_Eg0205\main.cpp(12) : error C2373: 'GetMessageMap' : redefinition; different type modifiers
        E:\MFC\MFC_Eg0205\main.cpp(9) : see declaration of 'GetMessageMap'
E:\MFC\MFC_Eg0205\main.cpp(12) : error C2143: syntax error : missing ';' before 'tag::id'
E:\MFC\MFC_Eg0205\main.cpp(12) : error C2734: 'AFX_MSGMAP' : const object must be initialized if not extern
E:\MFC\MFC_Eg0205\main.cpp(12) : error C2371: 'AFX_MSGMAP' : redefinition; different basic types
        E:\MFC\MFC_Eg0205\main.cpp(12) : see declaration of 'AFX_MSGMAP'
E:\MFC\MFC_Eg0205\main.cpp(12) : fatal error C1004: unexpected end of file found
Error executing cl.exe.main.obj - 10 error(s), 0 warning(s)请帮忙看一看是不是缺少了什么?