Hey everyone, I'm having this problem with the aforementioned API.
Here is the code to initialize the common controls i want to use..(commctrl.h is already included in my program)

INITCOMMONCONTROLSEX icex;
   icex.dwSize=sizeof(INITCOMMONCONTROLSEX);
  icex.dwICC=ICC_BAR_CLASSES;
   InitCommonControlsEx(&icex);

However, when I try to build , it gives me this error:

1>tkud.obj : error LNK2019: unresolved external symbol __imp__InitCommonControls@0 referenced in function _WinMain@16
1>C:\Users\kudayisi\Documents\Visual Studio 2008\Projects\comctrl\Debug\comctrl.exe : fatal error LNK1120: 1 unresolved externals

I'm using Visual C++ 2008 Express Edition.

Any positive help on this matter would be highly appreciated.

Yep, nezachem is correct, the prototypes in that header mean nothing if they aren't linked with the right library. Try linking to comctl32.lib.

I do not know how to link,please throw more light on that

The easy way, at the very start of your code, add this line:

#pragma comment(lib, "comctl32.lib")

Edited 6 Years Ago by William Hemsworth: n/a

the easiest..don't need InitCommonControlsEx(&icex); nor InitCommonControls();

#pragma comment(linker,"/manifestdependency:\"type='win32 name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

i'm sorry..:)

Edited 6 Years Ago by cikara21: n/a

My project has compiled. Thanks to you all for your contributions,I
really appreciate it!!

This question has already been answered. Start a new discussion instead.