• Advertisement
Sign in to follow this  

InitCommonControlsEx

This topic is 4343 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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'

Share this post


Link to post
Share on other sites
Advertisement
If that is your exact code then this line is missing a semicolon:

InitCtrlEx.dwSize=sizeof(INITCOMMONCONTROLSEX)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Colin Jeanne
Try doing a clean rebuild of your project



This did not change anything.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement