Win32的ATL COM项目转成WinCE编译时出现"DllMain function cannot be overloaded"的问题
Win32的ATL COM项目转成WinCE项目编译时出现:
error C2731: 'DllMain' : function cannot be overloaded
see declaration of 'DllMain'
error C2733: second C linkage of overloaded function 'DllMain' not allowed
see declaration of 'DllMain'
错误原因:
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
extern "C" BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved)
将HINSTANCE改成HANDLE就可以了