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

            創(chuàng)作,也是一種學(xué)習(xí)的過(guò)程。

               :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::

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

            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!

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

            如果你在應(yīng)用程序向?qū)Ю镏付ǖ氖且粋€(gè)Windows程序,而你后來(lái)卻在這個(gè)連接器選項(xiàng)里選擇Console,那會(huì)怎么樣呢?——會(huì)連接失敗!因?yàn)閂C++連接器認(rèn)為Console程序和Windows程序的入口函數(shù)是不同,這樣簡(jiǎn)單的一改它會(huì)找不到入口函數(shù),所以連接失敗。

            但不管這樣,通過(guò)Charles Petzold的這段描述,我們對(duì)Console程序和Windows程序的認(rèn)識(shí)應(yīng)該是沒(méi)什么問(wèn)題了,兩者其實(shí)并沒(méi)有什么根本不同,只是Windows根據(jù)PE文件中的標(biāo)識(shí),用稍微不同的方法來(lái)運(yùn)行這兩種程序而已。

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

            posted on 2010-09-15 10:01 Jiang Guogang 閱讀(3071) 評(píng)論(0)  編輯 收藏 引用 所屬分類(lèi): Windows Programming
            国产视频久久| 亚洲精品无码久久久久AV麻豆| 日本精品一区二区久久久| 热综合一本伊人久久精品| 欧美久久久久久| 久久久久夜夜夜精品国产| 国产成人香蕉久久久久| 亚洲国产成人久久精品99| 久久亚洲精品成人av无码网站| 国产精品久久久久久一区二区三区| 观看 国产综合久久久久鬼色 欧美 亚洲 一区二区 | 久久久久亚洲AV无码专区体验| 国产精品久久久久影视不卡| 日韩电影久久久被窝网| 久久精品人人做人人妻人人玩| 久久www免费人成看国产片| 久久久无码人妻精品无码| 久久久久97国产精华液好用吗| 久久精品中文闷骚内射| 亚洲精品国产自在久久| 久久久久久综合一区中文字幕 | 久久精品国产亚洲AV电影| 久久精品国产只有精品66| 精品久久久久久成人AV| 欧美亚洲国产精品久久| 欧美日韩中文字幕久久久不卡| 久久免费线看线看| 国产精品久久久久久久久| 欧美午夜精品久久久久免费视 | 久久亚洲AV无码西西人体| 久久免费高清视频| 久久精品国产99久久无毒不卡| 狠狠色丁香久久婷婷综合| 要久久爱在线免费观看| 中文字幕久久精品| 大香伊人久久精品一区二区| 久久天天躁狠狠躁夜夜不卡| 久久精品国产亚洲av麻豆蜜芽| 久久天天躁狠狠躁夜夜不卡| 伊人久久无码中文字幕| 少妇久久久久久久久久|