• <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   回復  更多評論
              

            久久国产精品成人影院| 国内精品伊人久久久影院| 久久午夜羞羞影院免费观看| 久久精品国产亚洲av高清漫画 | AV无码久久久久不卡蜜桃| 精品久久久久久无码国产 | 亚洲国产成人乱码精品女人久久久不卡 | 久久综合日本熟妇| 亚洲国产成人久久综合碰碰动漫3d| 开心久久婷婷综合中文字幕| 久久婷婷五月综合国产尤物app| 国产精品久久久久久福利漫画| 久久精品国产男包| 精品久久久久久国产免费了| 色8久久人人97超碰香蕉987| 99久久精品无码一区二区毛片| 久久99精品久久久大学生| segui久久国产精品| 国产精品久久网| 亚洲精品乱码久久久久久久久久久久 | 亚洲精品美女久久久久99小说 | 成人妇女免费播放久久久| 三级片免费观看久久| 久久九九久精品国产免费直播| 国产精品内射久久久久欢欢| 久久综合给合久久狠狠狠97色69 | 久久国产精品无码网站| 精品久久久久久国产潘金莲 | 精品多毛少妇人妻AV免费久久| 久久国产精品一国产精品金尊| 久久久噜噜噜久久中文字幕色伊伊| 久久一区二区三区免费| 青青久久精品国产免费看| 国产免费久久久久久无码| 91精品国产综合久久香蕉 | 日本精品久久久久影院日本 | 国产日产久久高清欧美一区| 九九热久久免费视频| 狠狠精品干练久久久无码中文字幕| 精品一区二区久久| 韩国三级中文字幕hd久久精品|