2011-01-05 6 views
1
#include <windows.h> 
#include <stdlib.h> 
#include <tchar.h> 
#ifdef __cplusplus 
extern "C" 
#endif 
void * _ReturnAddress(void); 

#pragma intrinsic(_ReturnAddress) 
//I inserted the following code inside one of the functions 

void func() 
{ 
------------ 
------- 
---- 
- 
    HMODULE module_handle; 
    TCHAR module_name[4096]; 
    DWORD flag = 0x00000004; 

    GetModuleHandleEx(flag, (LPCTSTR) _ReturnAddress(), &module_handle); 

    GetModuleFileName(module_handle,module_name,4096); 

----- 
-- 
} 

コードを別のプロジェクトとしてコンパイルすると、すべて正常に動作します。助けてください。コンパイラエラー:C3861 'GetModuleHandleEx':識別子が見つかりません

答えて

1

To compile an application that uses this function, define _WIN32_WINNT as 0x0501 or later. For more information, see Using the Windows Headers .

+0

参照番号 – Bruce

+0

を直接MSDNライブラリの記事から提供してください。 –

+0

私は心を失っているようです: – Bruce

関連する問題