• <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 閱讀(3085) 評論(0)  編輯 收藏 引用 所屬分類: Windows Programming
            欧美成人免费观看久久| 久久婷婷五月综合97色一本一本| 国产精品免费看久久久香蕉| 久久99精品国产麻豆蜜芽| 久久午夜免费视频| 久久精品免费一区二区三区| 怡红院日本一道日本久久 | 人妻精品久久无码专区精东影业| 国产精品视频久久| 无码AV波多野结衣久久| 久久国产福利免费| 2022年国产精品久久久久| 中文国产成人精品久久亚洲精品AⅤ无码精品| 久久午夜无码鲁丝片秋霞| 91精品婷婷国产综合久久| 天天躁日日躁狠狠久久| 中文精品99久久国产| 精品久久久无码中文字幕| 久久国产乱子精品免费女| 亚洲午夜无码久久久久| 久久久久亚洲国产| 久久精品国产一区二区三区不卡| 狠狠干狠狠久久| 久久久久亚洲Av无码专| 麻豆一区二区99久久久久| 久久精品一区二区三区AV| 国产一区二区久久久| 狠狠色丁香婷婷久久综合五月 | 欧美精品乱码99久久蜜桃| 亚洲另类欧美综合久久图片区| segui久久国产精品| 91精品国产91久久久久久蜜臀| 欧美一区二区精品久久| 久久成人国产精品二三区| 国产精品久久久久影视不卡| 久久91综合国产91久久精品| 狠狠狠色丁香婷婷综合久久俺| 久久―日本道色综合久久| 99久久国产主播综合精品 | 国产精品久久久久久久久久免费| 国产综合成人久久大片91|