简体   繁体   English

如何禁用MFC应用程序的WinMain入口点?

[英]How to disable WinMain entry point for a MFC application?

I understand that is not possible to have applications with multiple entry points under Windows. 我知道在Windows下不可能有带有多个入口点的应用程序。

I have a MFC application and I added code for making it running as a service ( main() entry point and other required stuff) but it looks that Windows will always run the WinMain() from MFC instead of my main. 我有一个MFC应用程序,并添加了使它作为服务运行的代码( main()入口点和其他必需的东西),但是Windows似乎总是从MFC而不是我的main运行WinMain()

The question is how can I disable the WinMain() from MFC in order to be able to run my own main() . 问题是如何才能从MFC禁用WinMain()以便能够运行自己的main()

Probably the same problem would apply if you want to run the same application as a console application. 如果您要运行与控制台应用程序相同的应用程序,可能会遇到相同的问题。

What do I have to change in project properties in order to build it as a console application (main instead of WinMain)? 为了将其构建为控制台应用程序(主要而不是WinMain),我必须在项目属性中进行哪些更改?

Is commenting my CWinApp the only solution? 评论我的CWinApp是唯一的解决方案吗?

If you look at the linker settings you can change the entry point. 如果查看链接器设置,则可以更改入口点。 This is where you want to be looking. 这是您想要的地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM