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

            評論

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

            国产精品美女久久久久久2018| 国产美女久久久| 久久天天躁狠狠躁夜夜2020一| 亚洲午夜无码久久久久小说| 亚洲欧美成人综合久久久 | 精品蜜臀久久久久99网站| 狠狠色丁香久久综合五月| 久久人人爽人人爽人人片AV东京热| 7777精品伊人久久久大香线蕉| avtt天堂网久久精品| 久久久久久av无码免费看大片| 久久偷看各类wc女厕嘘嘘| 久久久免费观成人影院| 久久99国产精品久久99果冻传媒| 日韩美女18网站久久精品| 人人狠狠综合久久亚洲88| 亚洲va久久久噜噜噜久久天堂| 久久久久久国产精品免费免费 | 无码人妻精品一区二区三区久久 | 亚洲综合精品香蕉久久网97| 国产成人久久精品一区二区三区| 国产亚洲成人久久| 久久亚洲AV成人出白浆无码国产| 热99RE久久精品这里都是精品免费 | 中文字幕久久精品无码| 日韩AV毛片精品久久久| 精品欧美一区二区三区久久久 | 亚洲AV乱码久久精品蜜桃| 久久久久久久免费视频| 久久人人爽人爽人人爽av| 一级做a爰片久久毛片人呢| 99久久婷婷国产综合亚洲| 日本强好片久久久久久AAA | 91精品国产91久久久久久青草| 精品久久一区二区三区| 久久久青草青青亚洲国产免观| 狠狠色噜噜狠狠狠狠狠色综合久久| 精品熟女少妇a∨免费久久| 99久久人妻无码精品系列蜜桃| 国产精品美女久久久m| 久久国产高清字幕中文|