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

            Jiang's C++ Space

            創作,也是一種學習的過程。

               :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::

            這是我在《Programming Microsoft Windows with C#》(此書作者是大名鼎鼎的Charles Petzold)一書中找到的描述:

            This compiler switch doesn't do anything very profound. It really only sets a flag in the executable file that indicates how the program is to be loaded an run. If an executable is flagged as a Console Application and is started from Windows, the Windows operating system creates a Command Prompt window that launches the program and displays any console output from the program. If the console application is started from within the Command Prompt window, the MS-DOS promptdoesn't return until the program terminateds. If the executable is flagged as a Windows Application, no Command Prompt window is created. Any console output from the program goes into the bit bucket. If you start such a program from the Command Prompt window, the MS-DOS prompt appears again right after the program is launched. The point is this: nothing bad happens if you compile a Windows Forms application as a console application!

            作者之前提到的編譯選項是/target:exe和/target:winexe,前者生成控制臺程序,后者生成Windows程序,這是C#的編譯器,而VC++的連接器的選項卻有些不同,看這張圖:

            如果你在應用程序向導里指定的是一個Windows程序,而你后來卻在這個連接器選項里選擇Console,那會怎么樣呢?——會連接失敗!因為VC++連接器認為Console程序和Windows程序的入口函數是不同,這樣簡單的一改它會找不到入口函數,所以連接失敗。

            但不管這樣,通過Charles Petzold的這段描述,我們對Console程序和Windows程序的認識應該是沒什么問題了,兩者其實并沒有什么根本不同,只是Windows根據PE文件中的標識,用稍微不同的方法來運行這兩種程序而已。

            BTW:Windows程序可以創建自己的控制臺(參考AllocConsole等API),控制臺程序也可以創建窗口。

            posted on 2010-09-15 10:01 Jiang Guogang 閱讀(3073) 評論(0)  編輯 收藏 引用 所屬分類: Windows Programming
            国产精品久久新婚兰兰| 91精品国产91久久久久久蜜臀| 精品久久久久久99人妻| 久久高清一级毛片| 日本精品一区二区久久久| 久久亚洲精精品中文字幕| 99热热久久这里只有精品68| 久久精品中文无码资源站| 久久精品国产99国产精偷| 久久AⅤ人妻少妇嫩草影院| 伊人久久大香线蕉AV一区二区| 亚洲综合精品香蕉久久网97| 模特私拍国产精品久久| 久久99久久无码毛片一区二区| 国产成人精品综合久久久| 亚洲精品tv久久久久久久久久| 久久久久免费看成人影片| 无码人妻久久一区二区三区| 久久久久久久久久久| 91精品国产高清久久久久久91| 欧美噜噜久久久XXX| 合区精品久久久中文字幕一区| 久久九九亚洲精品| 亚洲国产精品久久久久婷婷老年| 热久久视久久精品18| 国産精品久久久久久久| 久久久精品2019免费观看| 中文字幕无码免费久久| 久久国产劲爆AV内射—百度| 欧美亚洲日本久久精品| 久久天天躁狠狠躁夜夜2020| 久久人人青草97香蕉| 国产高清国内精品福利99久久| 久久免费视频网站| 国产成年无码久久久久毛片| 日本一区精品久久久久影院| 国产成人久久激情91| 久久精品夜色噜噜亚洲A∨| 国产精品久久新婚兰兰| 成人午夜精品无码区久久| 亚洲中文字幕无码久久综合网|