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

            aaa级精品久久久国产片| 国产精品女同一区二区久久| 亚洲国产成人精品女人久久久 | 99久久精品国产一区二区蜜芽 | 亚洲国产成人久久精品动漫| 国产午夜精品理论片久久| 亚洲国产精品狼友中文久久久 | 久久精品成人| 久久影院综合精品| 久久精品国产72国产精福利| 久久精品国产亚洲AV麻豆网站| 四虎国产精品免费久久5151| 久久婷婷色综合一区二区| 国产A级毛片久久久精品毛片| 免费精品久久天干天干| 99久久伊人精品综合观看| 亚洲AV无码久久寂寞少妇| 人妻中文久久久久| 66精品综合久久久久久久| 久久久久波多野结衣高潮| 人人狠狠综合久久亚洲高清| 国产精品久久久久9999高清| 亚洲av伊人久久综合密臀性色| 久久久久久无码国产精品中文字幕 | 久久国产热这里只有精品| 精品久久无码中文字幕| 午夜天堂av天堂久久久| 欧美精品国产综合久久| 亚洲精品久久久www| 国产精品99久久精品爆乳| 亚洲国产成人久久精品动漫| 精品免费tv久久久久久久| 看久久久久久a级毛片| 蜜臀av性久久久久蜜臀aⅴ麻豆 | 久久精品国产一区二区三区 | 久久精品国产99国产精品| 国产成人久久久精品二区三区 | 欧美伊人久久大香线蕉综合 | 一级做a爰片久久毛片人呢| 色偷偷888欧美精品久久久| 91久久九九无码成人网站|