我正在使用 mingw G++(都在 Windows 10 上)将 VS2015 C++ directx/winforms 应用程序转换为 VS 代码。
我在添加 -mwindows 选项(和一大堆库)后对其进行编译和链接,但是在进入 WinMain 时,hInstance 没有任何价值。
#include <objbase.h>
#include <windows.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
LoadString(hInstance, IDS_APP_TITLE,g_szAppName, MAX_LOADSTRING);
...
这会导致任何依赖于它的东西,比如 LoadString 或 RegisterClassEx 不起作用。
我应该寻找什么?