按键盘上方向键 ← 或 → 可快速上下翻页,按键盘上的 Enter 键可回到本书目录页,按键盘上方向键 ↑ 可回到本页顶部!
————未阅读完?加入书签已便下次继续阅读!
#0034 #define CMyViewid 1221
#0035 #define CDocumentid 13
#0036 #define CMyDocid 131
#0037
#0038 #include
#0039
#0040 /////////////////////////////////////////////////////////////////
203
…………………………………………………………Page 266……………………………………………………………
第篇 勿在浮砂築高台
#0041 // Window message map handling
#0042
#0043 struct AFX_MSGMAP_ENTRY; // declared below after CWnd
#0044
#0045 struct AFX_MSGMAP
#0046 {
#0047 AFX_MSGMAP* pBaseMessageMap;
#0048 AFX_MSGMAP_ENTRY* lpEntries;
#0049 };
#0050
#0051 #define DECLARE_MESSAGE_MAP()
#0052 static AFX_MSGMAP_ENTRY _messageEntries'';
#0053 static AFX_MSGMAP messageMap;
#0054 virtual AFX_MSGMAP* GetMessageMap() const;
#0055
#0056 #define BEGIN_MESSAGE_MAP(theClass; baseClass)
#0057 AFX_MSGMAP* theClass::GetMessageMap() const
#0058 { return &theClass::messageMap; }
#0059 AFX_MSGMAP theClass::messageMap =
#0060 { &(baseClass::messageMap);
#0061 (AFX_MSGMAP_ENTRY*) &(theClass::_messageEntries) };
#0062 AFX_MSGMAP_ENTRY theClass::_messageEntries'' =
#0063 {
#0064
#0065 #define END_MESSAGE_MAP()
#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