dissecting MFC 2e part1

Page 266

第3章

MFC 六大關鍵技術之模擬

Frame8 測 試㆕ 種情 況: 分別 從 frame 物 件和 view 物件 ㆗推 動訊 息, 訊息 分㆒ 般 Windows 訊息和 WM_COMMAND 兩種: // test Message Routing AfxWndProc(0, WM_CREATE, 0, 0, pMyFrame); AfxWndProc(0, WM_PAINT, 0, 0, pMyView); AfxWndProc(0, WM_COMMAND, 0, 0, pMyView); AfxWndProc(0, WM_COMMAND, 0, 0, pMyFrame);

Frame8 的命令列編譯聯結動作是(環境變數必須先設定好,請參考第4章的「安裝與設 定」㆒節): cl my.cpp mfc.cpp

<Enter>

以㆘是 Frame8 的執行結果: CWinApp::InitApplication CMyWinApp::InitInstance CFrameWnd::Create CWnd::CreateEx CFrameWnd::PreCreateWindow CWinApp::Run CWinThread::Run pMyFrame received a WM_CREATE, routing path and call stack: AfxWndProc() AfxCallWndProc() CWnd::WindowProc() 1211 CMyFrameWnd 121 CFrameWnd 12 CWnd 1 CCmdTarget pMyView received a WM_PAINT, routing path and call stack: AfxWndProc() AfxCallWndProc() CWnd::WindowProc() 1221 CMyView 122 CView 12 CWnd 1 CCmdTarget pMyView received a WM_COMMAND, routing path and call stack: AfxWndProc()

201


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.