• <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 張貴川 閱讀(427) 評論(1)  編輯 收藏 引用

            評論

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

            久久精品国产一区| 久久99国产精品久久99| 国产一级持黄大片99久久| 国产精品一久久香蕉国产线看观看| 一极黄色视频久久网站| 国产偷久久久精品专区| 国产精品久久久久久久| 午夜精品久久影院蜜桃| 麻豆精品久久精品色综合| 久久国产劲爆AV内射—百度| 国产69精品久久久久777| 亚洲国产精品婷婷久久| 97久久婷婷五月综合色d啪蜜芽| 色综合久久久久综合体桃花网| 国产精品免费看久久久香蕉| 热re99久久精品国99热| 一本色道久久88综合日韩精品 | 久久综合狠狠综合久久97色| 天天爽天天狠久久久综合麻豆| 91久久精品91久久性色| 久久综合久久伊人| 日韩欧美亚洲综合久久影院d3| 99久久夜色精品国产网站| 久久国产热这里只有精品| 精品免费久久久久国产一区| 91久久国产视频| 久久久久久国产精品无码下载| 国产精品亚洲综合专区片高清久久久| 伊色综合久久之综合久久| 狠狠色丁香婷婷综合久久来来去| 色狠狠久久AV五月综合| 99久久香蕉国产线看观香| 综合久久国产九一剧情麻豆| 久久国产免费直播| 国产免费久久精品丫丫| 亚洲狠狠久久综合一区77777 | 久久精品国产精品亚洲精品 | 中文字幕无码久久人妻| 精品久久久久久久久久中文字幕| 久久久久无码精品国产| 久久久久四虎国产精品|