Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ToolBar - Link Error when calling InitCommonControlsEx() 1

Status
Not open for further replies.

genio1981

Programmer
May 23, 2003
8
0
0
US
WIN API confusion!
I have gone through several tutorials (yes, I am a beginner) to try to learn how to place a toolbar on my program. It seems every tutorial (including MSDN) does it the same way.
There is a problem for me with this, when I call InitCommonControlsEx(&iccx) when iccx is an INITCOMMONCONTROLSEX struct, I get a link error. Also, I have tried the other way of initializing the common controls, InitCommonControls() which gives the same link error.
I am using MS Visual C++6 and windows XP with all current updates. #include <commctrl.h> also being used. I have also tried to just create a simple one-button toolbar without using any of the InitCommonControls functions, and with no surprise, the toolbar failed to load. Any Help??
 
Genio,
you must add comctl32.lib when linking.

Project --> Settings, choose the Link Page and add it to the other libs in the Project Options box.

Marcel
 
Seems to work now, however... now I am getting a
First-chance exception in LabelMaker2.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
this wasnt appearing before adding the lib to the link list
any ideas on why that is?
 
Sorry, I found my problem... the ZeroMemory() function cleared up my problem... used it on the array of buttons and no more problems
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top