深入浅出MFC第2版(PDF格式)-第50部分
按键盘上方向键 ← 或 → 可快速上下翻页,按键盘上的 Enter 键可回到本书目录页,按键盘上方向键 ↑ 可回到本页顶部!
————未阅读完?加入书签已便下次继续阅读!
#0066 { 0; 0; 0; 0; AfxSig_end; (AFX_PMSG)0 }
#0067 };
#0068
#0069 // Message map signature values and macros in separate header
#0070 #include 〃afxmsg_。h〃
#0071
#0072 class CObject
#0073 {
#0074 public:
#0075 CObject::CObject() {
#0076 }
#0077 CObject::~CObject() {
#0078 }
#0079 };
#0080
#0081 class CCmdTarget : public CObject
#0082 {
#0083 public:
#0084 CCmdTarget::CCmdTarget() {
#0085 }
#0086 CCmdTarget::~CCmdTarget() {
204
…………………………………………………………Page 267……………………………………………………………
第3章 MFC 六大關鍵技術之模擬
#0087 }
#0088
#0089 virtual BOOL OnCmdMsg(UINT nID; int nCode);
#0090
#0091 DECLARE_MESSAGE_MAP() // base class no {{ }} macros
#0092 };
#0093
#0094 typedef void (CCmdTarget::*AFX_PMSG)(void);
#0095
#0096 struct AFX_MSGMAP_ENTRY // MFC 4。0
#0097 {
#0098 UINT nMessage; // windows message
#0099 UINT nCode; // control code or WM_NOTIFY code
#0100 UINT nID; // control ID (or 0 for windows messages)
#0101 UINT nLastID; // used for entries specifying a range of control id's
#0102 UINT nSig; // signature type (action) or pointer to message #
#0103 AFX_PMSG pfn; // routine to call (or special value)
#0104 };
#0105
#0106 class CWinThread : public CCmdTarget
#0107 {
#0108 public:
#0109 CWinThread::CWinThread() {
#0110 }
#0111 CWinThread::~CWinThread() {
#0112 }
#0113
#0114 virtual BOOL InitInstance() {
#0115 cout