• <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>

            斜樹的空間

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

              C++博客 :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
              47 隨筆 :: 0 文章 :: 12 評(píng)論 :: 0 Trackbacks

               全局變量的定義:
            在MFC的框架中有個(gè)全局變量:
            CTestApp theApp;
            theApp是在進(jìn)入WinMain函數(shù)之前就構(gòu)造好值的。
            所以可以進(jìn)入WinMain函數(shù)之前是先執(zhí)行theApp的構(gòu)造函數(shù)。
            孫鑫老師說MFC是通過應(yīng)用程序類的對(duì)象來標(biāo)識(shí)應(yīng)用程序的實(shí)例的(這句話不明白,應(yīng)該都是hInstance標(biāo)識(shí)的吧,也許要等到我看侯捷老師書的時(shí)候才知道了),且每個(gè)MFC程序有且僅有一個(gè)從CWinApp派生的類。也僅有一個(gè)CWinApp派生類的對(duì)象,即僅有一個(gè)theApp對(duì)象。theApp對(duì)象就標(biāo)識(shí)了應(yīng)用程序本身。
            即theApp是統(tǒng)領(lǐng)其它類的。
            并且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中還提供了一些額外的操作全局信息的函數(shù):

          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()函數(shù):
            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) 評(píng)論(1)  編輯 收藏 引用

            評(píng)論

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


            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            色欲综合久久躁天天躁蜜桃| 四虎国产精品免费久久久| 狠狠色丁香婷婷久久综合五月| 一本大道久久东京热无码AV| 久久99热这里只有精品国产| 狠狠色丁香久久综合婷婷| 久久涩综合| 久久777国产线看观看精品| 久久久久亚洲精品日久生情| 国产成人精品久久亚洲高清不卡 国产成人精品久久亚洲高清不卡 国产成人精品久久亚洲 | 午夜精品久久久久久中宇| 高清免费久久午夜精品| 久久伊人色| 91久久九九无码成人网站| 欧美喷潮久久久XXXXx| 久久久久亚洲?V成人无码| 国产精品99久久久久久人| av色综合久久天堂av色综合在| 久久国产成人| 久久亚洲国产精品一区二区| 久久久久亚洲AV片无码下载蜜桃| 久久天天躁狠狠躁夜夜不卡| 色综合色天天久久婷婷基地| 久久免费视频网站| 久久免费高清视频| 国产一区二区三区久久| 99久久中文字幕| 久久精品aⅴ无码中文字字幕不卡| 久久这里都是精品| 2021最新久久久视精品爱| 亚洲午夜无码久久久久小说| 久久久久97国产精华液好用吗| 国产精品熟女福利久久AV| 国产精品成人无码久久久久久 | 国产69精品久久久久777| 麻豆亚洲AV永久无码精品久久| 国内精品久久久久影院薰衣草| 中文字幕精品久久| 久久久久亚洲av综合波多野结衣| 久久精品成人欧美大片| 久久婷婷成人综合色综合|