简体   繁体   English

Windows 可以在 Static 库 ZF6F87C9FDCF8B3C3F07F93F1EEZ8 中调用 WinMain function

[英]Can Windows call the WinMain function in a Static Library C++

I have created a Static library which contains a WinMain() function that has to be called.我创建了一个 Static 库,其中包含一个必须调用的 WinMain() function。 I'm searching for some way to make windows call this function.我正在寻找使 windows 称为 function 的方法。

The reason is to have a solution without a Main Function, in which the user just inherit and fill some classes, and if he hits the play button, the solution runs.原因是有一个没有 Main Function 的解决方案,其中用户只需继承并填充一些类,如果他点击播放按钮,解决方案就会运行。

Also, if you think my approach is not the best, tell me how you will afford this.另外,如果您认为我的方法不是最好的,请告诉我您将如何负担得起。

You could add #pragma comment(linker, "/entry:fn") to modify the entry function.您可以添加#pragma comment(linker, "/entry:fn")来修改条目function。 Also, you could refer to Microsoft documents另外,你可以参考微软文档

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

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