• <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
            久久国产成人精品国产成人亚洲| 久久久久久久99精品免费观看| 久久综合伊人77777| 久久久久久久波多野结衣高潮| 久久久久国产一级毛片高清版| 大美女久久久久久j久久| 国产精品久久久久久一区二区三区| 亚洲美日韩Av中文字幕无码久久久妻妇| 久久亚洲精精品中文字幕| 久久久国产视频| 伊人久久大香线蕉成人| 丁香狠狠色婷婷久久综合| 色99久久久久高潮综合影院 | 亚洲欧美精品一区久久中文字幕| 中文成人无码精品久久久不卡| 亚洲午夜精品久久久久久人妖| 久久精品国产亚洲综合色| 日韩一区二区久久久久久| 热久久最新网站获取| 国产精品99久久久久久www| 国产成人久久精品一区二区三区| 久久夜色精品国产噜噜亚洲AV| 色天使久久综合网天天| 久久久久国产| 综合网日日天干夜夜久久| 久久精品国产精品亚洲精品| 久久亚洲天堂| 精品国产热久久久福利| 国产免费福利体检区久久| 久久精品国产亚洲一区二区| 久久国产精品久久国产精品| 无码人妻精品一区二区三区久久久| 99久久99久久精品免费看蜜桃| 亚洲AV日韩精品久久久久| 亚洲va中文字幕无码久久 | 色欲久久久天天天综合网精品| 亚洲国产成人久久笫一页| 欧美亚洲国产精品久久久久| 久久中文字幕精品| 一本色道久久99一综合| 久久久久亚洲av无码专区喷水 |