InitCommonControlsEx

Started by
5 comments, last by athono 18 years ago
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'
Advertisement
If that is your exact code then this line is missing a semicolon:

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.
Try doing a clean rebuild of your project
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.

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." --Benjamin Franklin

Thanks all. I have contributed to your rates.

This topic is closed to new replies.

Advertisement