InitCommonControlsEx
I am trying to use InitCommonControlsEx in a Microsoft C++ program but I get an error and I think I am following the documentation for this function call.
I wonder what I am doing wrong here:
INITCOMMONCONTROLSEX InitCtrlEx;
InitCtrlEx.dwSize=sizeof(INITCOMMONCONTROLSEX)
InitCommonControlsEx(&InitCtrlEx);
And why I get this error:
error C2440: 'type cast' : cannot convert from 'int' to 'struct tagINITCOMMONCONTROLSEX'
If that is your exact code then this line is missing a semicolon:
InitCtrlEx.dwSize=sizeof(INITCOMMONCONTROLSEX)
InitCtrlEx.dwSize=sizeof(INITCOMMONCONTROLSEX)
Quote:Original post by Colin Jeanne
If that is your exact code then this line is missing a semicolon:
InitCtrlEx.dwSize=sizeof(INITCOMMONCONTROLSEX)
Thanks.
But now I get this error:
error LNK2001: unresolved external symbol __imp__InitCommonControlsEx@4
Documentation says to link to comctrl32.dll, but "comctl32.lib"
is included in the link list.
Quote:Original post by Colin Jeanne
Try doing a clean rebuild of your project
This did not change anything.
Put this at the top of your code:
#pragma comment(lib, "comctl32.lib")
Its likely not in your list unless you put it there. Plus cannot hurt to add that in just to be sure.
#pragma comment(lib, "comctl32.lib")
Its likely not in your list unless you put it there. Plus cannot hurt to add that in just to be sure.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement