Sign in to follow this  
athono

InitCommonControlsEx

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this