关于'GetModuleHandleEx': identifier not found

  关于'GetModuleHandleEx': identifier not found的问题 收藏
引入<windows.h>后仍然提示'GetModuleHandleEx': identifier not found

查看了一下这个函数是在<winbase.h>中定义的:

#if !defined(RC_INVOKED)

#if _WIN32_WINNT > 0x0500 || defined(WINBASE_DECLARE_GET_MODULE_HANDLE_EX) || ISOLATION_AWARE_ENABLED

...................................

#ifdef UNICODE

#define GetModuleHandleEx  GetModuleHandleExW

#else

#define GetModuleHandleEx  GetModuleHandleExA

#endif // !UNICODE

#endif

#endif


所以需要在程序前面加一行#define _WIN32_WINNT 0x0501 (应该是大于0x0500即可)

另外发现#include <stdafx>之后就找不到GetModuleHandleEx的定义了,有空再认真探究一下,

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/PandorasBox/archive/2010/01/03/5124225.aspx

原文地址:https://www.cnblogs.com/kevinzhwl/p/3878912.html