//hello.h文件class CMyApp : public CWinApp  
{
public:
    virtual BOOL InitInstance ();
};class CMainWindow : public CFrameWnd  
{
public:
    CMainWindow ();protected:
    afx_msg void OnPaint (); //这句afx_msg是什么意思,起什么作用?
    DECLARE_MESSAGE_MAP ()   //这是语句么?不是的话起什么作用?
};

解决方案 »

  1.   

    afx_msg 这是一个消息映射函数
    DECLARE_MESSAGE_MAP () 宏语句
      

  2.   

    #define afx_msg         // intentional placeholder
    是空的#define DECLARE_MESSAGE_MAP() \
    private: \
    static const AFX_MSGMAP_ENTRY _messageEntries[]; \
    protected: \
    static AFX_DATA const AFX_MSGMAP messageMap; \
    virtual const AFX_MSGMAP* GetMessageMap() const; \MFC框架通过它和另外几个主要的宏来实现消息机制的,再遇到类似情况可以自己一直跟下去
      

  3.   

    看看深入浅出MFC就什么都明白 了