如何构建VB6控制台应用程序

如何构建VB6控制台应用程序

问题描述:

我做了一些谷歌搜索来尝试回答这个问题,但是即使在那之后我还是不太清楚。是否可以从VB6创建控制台应用程序?

I did some googling to try to answer this question but even after that I'm not quite clear about something. Is it possible to create a console app from VB6?

我有一个不带窗口的VB6应用。我一直以为这是一个控制台应用程序。但是,我希望能够从其中使用Windows API SetConsoleCtrlHandler函数。我相信,对于C ++ / MFC应用程序,您必须设置一个链接器开关才能创建控制台应用程序。我的一位开发人员告诉我,VB6不能创建真正的控制台应用程序,因此这是行不通的。那么是否有可能创建Windows可以从VB6识别为控制台应用程序的控制台应用程序?

I've got a VB6 app that doesn't put up a window. I always assumed that it was a console app. However, I want to be able to use the Windows API SetConsoleCtrlHandler function from within it. I believe that with C++/MFC apps you have to set a linker switch to create a console app. And one of my fellow developers told me that VB6 doesn't create a true console app and therefore this would not work. So is it possible to create a console app that Windows will recognize as a console app from VB6?

平台:Windows XP SP2

Platform: Windows XP SP2

开发平台:VB6

是。也可以创建完全无头的应用程序(我过去已经做过几次)。 此链接提供了一个带有代码段的示例。

Yes. It's also possible to create totally headless applications (which I've done a few times in the past). This link gives an example with a code snippet.