• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            斜樹的空間

            集中精力,放棄一切的去做一件事情,只要盡力了,即使失敗了,你也不會后悔!

              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
              47 隨筆 :: 0 文章 :: 12 評論 :: 0 Trackbacks

               全局變量的定義:
            在MFC的框架中有個全局變量:
            CTestApp theApp;
            theApp是在進入WinMain函數之前就構造好值的。
            所以可以進入WinMain函數之前是先執行theApp的構造函數。
            孫鑫老師說MFC是通過應用程序類的對象來標識應用程序的實例的(這句話不明白,應該都是hInstance標識的吧,也許要等到我看侯捷老師書的時候才知道了),且每個MFC程序有且僅有一個從CWinApp派生的類。也僅有一個CWinApp派生類的對象,即僅有一個theApp對象。theApp對象就標識了應用程序本身。
            即theApp是統領其它類的。
            并且CWinApp類是派生于CWinThread類的,
            There are two general types of threads that CWinThread supports: worker threads and user-interface threads. Worker threads have no message pump: for example, a thread that performs background calculations in a spreadsheet application. User-interface threads have a message pump and process messages received from the system. CWinApp and classes derived from it are examples of user-interface threads. Other user-interface threads can also be derived directly from CWinThread.

            MSDN中還提供了一些額外的操作全局信息的函數:

          1. AfxGetApp   Obtains a pointer to the CWinApp object.

          2. AfxGetInstanceHandle   Obtains a handle to the current application instance.

          3. AfxGetResourceHandle   Obtains a handle to the application's resources.

          4. AfxGetAppName   Obtains a pointer to a string containing the application's name. Alternately, if you have a pointer to the CWinApp object, use m_pszExeName to get the application's name.

            看看MFC中的 main()函數:
            extern "C" int WINAPI
            _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
             _In_ LPTSTR lpCmdLine, int nCmdShow)
            #pragma warning(suppress: 4985)
            {
             // call shared/exported WinMain
             return AfxWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
            }

          5. posted on 2010-05-01 20:59 張貴川 閱讀(423) 評論(1)  編輯 收藏 引用

            評論

            # re: MFC框架的初讀(0) 2010-05-02 13:57 pywm
            Vc遠控編程愛好者群111720426   回復  更多評論
              

            久久久精品日本一区二区三区| 狠狠色丁香久久综合五月| 久久久久国产日韩精品网站| 久久伊人五月天论坛| 久久久精品人妻一区二区三区四| 久久香蕉综合色一综合色88| 日日狠狠久久偷偷色综合96蜜桃| 伊人久久大香线蕉av不变影院| 久久久久久狠狠丁香| 久久综合亚洲色HEZYO社区 | 日韩人妻无码一区二区三区久久| 久久久久四虎国产精品| 成人午夜精品无码区久久| 久久精品麻豆日日躁夜夜躁| 青春久久| 99久久精品无码一区二区毛片| 九九精品久久久久久噜噜| 9久久9久久精品| 久久久久久久波多野结衣高潮| 国产精品久久久久久久午夜片| 三上悠亚久久精品| 久久中文字幕人妻熟av女| 99久久精品国产综合一区 | 国产99久久久国产精品~~牛| 亚洲国产另类久久久精品黑人| 四虎影视久久久免费| 狠狠综合久久综合中文88| 青草影院天堂男人久久| 日韩AV无码久久一区二区| 久久无码中文字幕东京热| 久久午夜福利电影| 久久久精品久久久久久| 韩国三级中文字幕hd久久精品| 久久夜色tv网站| 国产成人精品久久亚洲高清不卡 国产成人精品久久亚洲高清不卡 国产成人精品久久亚洲 | 久久精品国产亚洲5555| 一本伊大人香蕉久久网手机| www.久久99| 久久久久四虎国产精品| 亚洲伊人久久大香线蕉苏妲己| 蜜桃麻豆www久久|