win32应用程序,窗体窗体应用程序和控制台应用程序之间有什么区别? [英] what is the difference between win32 application, windows form application and console application?

查看:1136
本文介绍了win32应用程序,窗体窗体应用程序和控制台应用程序之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道窗体应用程序,win32application ana控制台之间的区别,我知道窗体应用程序和win32应用程序是gui工具,但我想知道什么时候使用一个在另一个,我可以将控制台应用程序转换为Windows窗体应用程序吗?

解决方案

Windows窗体 。它不直接基于本机Windows API,而是基于.NET基础结构。其中包括一个虚拟机。



Win32 通常指的是32位Windows API。但是, _WIN32 宏是为32位和64位编程定义的。作为Visual Studio项目类型,它包括GUI和控制台子系统API级程序。



Windows子系统可执行文件的头,告诉Windows这个程序需要什么样的服务。该值可以通过例如Microsoft的 dumpbin 程序,例如 dumpbin c:\windows \\\
otepad.exe / headers |找到ubs
。在Windows 9x中, dumpbin 输出通过文件预览功能可用,但该功能已停止。



GUI子系统表示Windows将

em>尝试为每个实例装配相关的控制台窗口。然而,该过程本身可以创建控制台窗口。通常该子系统用于具有图形用户界面(因此,GUI)的普通程序,并且对于大多数链接器,它被指定为windows。





请注意,

$控制台子系统表示Windows将尝试为每个实例装配相关的控制台窗口, b
$ b

  • 相同的源代码可以构建为控制台或GUI子系统。这是非常容易做到的。


  • GUI子系统可执行文件具有标准流,就像控制台子系统可执行文件一样。


  • 控制台子系统可执行文件可以呈现图形用户界面,就像GUI一样。




另请注意




  • Microsoft的工具将默认不接受标准C ++ main 用于GUI子系统构建。然而,这种不合格的行为很容易解决。只需在链接器选项中指定 / entry:mainCRTStartup



这样的问题与GNU工具,即g ++。


I want to know what is the difference between windows form application, win32application ana console, i know that both the windows form application and win32 application is gui tool, but i want to know when to use one over the other one, and could I convert console application to windows form application ?

解决方案

Windows Form refers to a .NET application. It's not based directly on the native Windows API, but instead on the .NET infrastructure. Which includes a virtual machine.

Win32 generally refers to the 32-bit Windows API. However, the _WIN32 macro is defined for both 32-bit and 64-bit programming. As a Visual Studio project type it includes both GUI and console subsystem API-level programs.

A Windows subsystem is a small integer value in the executable's header that tells Windows what kind of services this program needs. This value can be inspected via e.g. Microsoft's dumpbin program, e.g. dumpbin c:\windows\notepad.exe /headers | find "ubs". In Windows 9x the dumpbin output was available via the file preview functionality, but that feature was discontinued.

Each process in Windows can be associated with one, and at most one, console window.

GUI subsystem means that Windows will NOT attempt to outfit each instance with an associated console window. The process can however create a console window itself. Usually this subsystem is used for ordinary programs with a graphical user interface (hence, "GUI"), and with most linkers it's specified as "windows".

Console subsystem means that Windows will attempt to outfit each instance with an associated console window, creating a new one if necessary.

Note that

  • The same source code can be built as console or GUI subsystem. And that's extremely easy to do. Just change the subsystem specification.

  • A GUI subsystem executable has standard streams, just as a console subsystem executable has.

  • A console subsystem executable can present a graphical user interface, just as a GUI one can.

Also note that

  • Microsoft's tools will by default not accept a standard C++ main for a GUI subsystem build. However, this non-conforming behavior is easy to fix. Just specify /entry:mainCRTStartup in the linker options.

There is no such problem with the GNU tools, that is, g++.

这篇关于win32应用程序,窗体窗体应用程序和控制台应用程序之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆