-
LoadImage() Problem
Code:
// Create an Icon
HICON hIcon;
HICON hIconSm;
hIcon = LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE);
if(!hIcon)
{
MessageBox(0, "Large Icon could not be loaded.", "Error #3", 0);
}
I'm getting an error on my hIcon = LoadIcon() line.. "invalid conversion from void* to "HICON__*" What's the problem? It looks fine to me! I'm using the win32 api and using dev-c++ 5 (g++)
-
try casting the result of LoadImage to HICON.
Also notice we have a windows board for questions particularly about windows api and mfc programming.
-
Wow! You're my hero man! Worked perfect! BTW is there any difference between a c-style cast and a c++ style cast? (static_cast)?
-
Yes some small differences. If using c++ then prefer the c++ style of casting.