BOOL (WINAPI *gmse)(LPMEMORYSTATUSEX) = GetProcAddress(
kernel32, "GlobalMemoryStatusEx");
這是在.cpp文件中。編譯上面的代碼時,我得到了下面的錯誤。無法從'FARPROC'轉換爲'BOOL(__cdecl *)(LPMEMORYSTATUSEX)'
error C2440: 'initializing' : cannot convert from 'FARPROC' to 'BOOL (__cdecl *)(LPMEMORYSTATUSEX)'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
我似乎無法找出什麼我應該投的GetProcAddress
功能。 有人可以請指出我在正確的方向嗎?
謝謝
爲宏保留ALL UPPERCASE標識符是一個好主意,以減少無意識文本替換的可能性。 – 2013-03-28 11:13:31
@ Cheersandhth.-Alf,關於替代點。更新。 – hmjd 2013-03-28 11:16:35