I'm using the following code to dynamically link to the LoadIconWithScaleDown API, for my code to be able to run on Windows XP:
HRESULT (WINAPI *pfnLoadIconWithScaleDown)(HINSTANCE, PCWSTR, int, int, HICON *);
HMODULE hComCtrl32 = LoadLibrary(_T("Comctl32.dll"));
if(hComCtrl32)
{
(FARPROC&)pfnLoadIconWithScaleDown = GetProcAddress(hComCtrl32, "LoadIconWithScaleDownW");
}
I try this code on Windows 7, but the 'pfnLoadIconWithScaleDown' is always NULL. Why?