在MyControl.h中,我有:
class CMyControl: public CRichEditCtrl
{
DECLARE_DYNAMIC( CMyControl)
public:
CMyControl();
virtual ~CMyControl();
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyControl)
//}}AFX_VIRTUAL
// Generated message map functions
protected:
//{{AFX_MSG(CMyControl)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnEnKillfocus();
afx_msg void OnEnChange();
afx_msg void OnEnMsgfilter(NMHDR *pNMHDR, LRESULT *pResult);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
每当我使用资源编辑器添加消息处理程序或事件覆盖方法或对话框控件成员变量时,它们总是在类的末尾添加。 {{AFX ...}}块的重点不在于保持这种组织吗?