Unicode编译模式下的GetProcAddress使用
By Minidxer | October 19, 2007
如果写成这样,
GetProcAddress(hModComCtl,_T("DllGetVersion"));
开启UNICODE模式的话,编译是会出错的。
GetProcAddress函数并没有区分GetProcAddressW/GetProcAddressA这样的区分,而GetProcAddress的第二个参数应该是LPCSTR (const char*),这是因为Win32平台函数在导出的时候函数名是ANSI字符,所以正确的写法是这样:
GetProcAddress(hModComCtl,“DllGetVersion”);
Topics:
程序开发相关 |
Tags: ANSI字符, const char, GetProcAddress, GetProcAddressA, GetProcAddressW, LPCSTR, UNICODE