0

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.

4
Contributors
6
Replies
8
Views
7 Years
Discussion Span
Last Post by tkud
0

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.

0

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

0

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

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

Edited by William Hemsworth: n/a

0

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 by cikara21: n/a

0

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.
Be sure to adhere to our posting rules.