SHGetIconOverlayIndex & GetProcAddress
-
I've already used the GetProcAddress function for half a dozen functions but it seems I've got a problem with that one. Might be a problem with the prototyping but there are few pages about it on the web and it is the first SH* function I try to get the address for. I tried all the prototypes I could imagine WINAPI, STDAPI, STDAPICALLTYPE with extern "C", dllimport and other __cdecl, __stdcall gave nothing. So here's the code, any idea welcome:
typedef int (__stdcall *LPFNSHGETICONOVERLAYINDEX)(LPCSTR, int); HMODULE hMod = ::GetModuleHandle(_T("Shell32.dll")); if (hMod) { LPFNSHGETICONOVERLAYINDEX lpfnSHGetIconOverlayIndex; lpfnSHGetIconOverlayIndex = (LPFNSHGETICONOVERLAYINDEX)GetProcAddress(hMod,_T("SHGetIconOverlayIndex")); if (lpfnSHGetIconOverlayIndex) { // There it fails m_nIndexOverlay = lpfnSHGetIconOverlayIndex("C:\\", IDO_SHGIOI_LINK); } }
Yarp http://www.senosoft.com/ -
I've already used the GetProcAddress function for half a dozen functions but it seems I've got a problem with that one. Might be a problem with the prototyping but there are few pages about it on the web and it is the first SH* function I try to get the address for. I tried all the prototypes I could imagine WINAPI, STDAPI, STDAPICALLTYPE with extern "C", dllimport and other __cdecl, __stdcall gave nothing. So here's the code, any idea welcome:
typedef int (__stdcall *LPFNSHGETICONOVERLAYINDEX)(LPCSTR, int); HMODULE hMod = ::GetModuleHandle(_T("Shell32.dll")); if (hMod) { LPFNSHGETICONOVERLAYINDEX lpfnSHGetIconOverlayIndex; lpfnSHGetIconOverlayIndex = (LPFNSHGETICONOVERLAYINDEX)GetProcAddress(hMod,_T("SHGetIconOverlayIndex")); if (lpfnSHGetIconOverlayIndex) { // There it fails m_nIndexOverlay = lpfnSHGetIconOverlayIndex("C:\\", IDO_SHGIOI_LINK); } }
Yarp http://www.senosoft.com/