• <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
            久久久噜噜噜久久| 亚洲精品乱码久久久久久蜜桃| 亚洲国产天堂久久综合| 老男人久久青草av高清| 日本久久久久亚洲中字幕| 久久亚洲精品无码AV红樱桃| 欧美亚洲国产精品久久蜜芽| 国产成人精品久久综合| 国产精品免费看久久久| 久久黄视频| 久久精品女人天堂AV麻| 国产99久久久国产精品小说| 国产ww久久久久久久久久| 色综合久久久久无码专区| 久久国产成人午夜AV影院| 亚洲精品无码久久一线| 欧美伊人久久大香线蕉综合| 国产精品成人无码久久久久久| 久久精品国产久精国产果冻传媒| 青青草国产精品久久| 久久久久久无码Av成人影院| 国产69精品久久久久APP下载| 狠狠精品干练久久久无码中文字幕 | 91麻豆国产精品91久久久| 99国内精品久久久久久久| 久久精品成人免费国产片小草| 国产亚洲色婷婷久久99精品91| 国产福利电影一区二区三区久久久久成人精品综合 | 99久久久国产精品免费无卡顿 | 日批日出水久久亚洲精品tv| 精品久久久久久| 精品免费tv久久久久久久| 婷婷久久久亚洲欧洲日产国码AV| 久久综合精品国产一区二区三区 | 97久久综合精品久久久综合| 少妇高潮惨叫久久久久久| 久久婷婷五月综合97色直播 | 亚洲精品视频久久久| 久久久久久精品免费免费自慰| 99久久香蕉国产线看观香| 亚洲综合伊人久久综合|