Click to See Complete Forum and Search --> : Is comctl32.lib required for progress bar controls?


JasonD
August 20th, 2004, 09:42 AM
Hello,

In a test application, I have a progress bar defined in one of my dialog boxes. In order for CreateDialog to succeed, I need to add comctl32.lib to my project, and also call InitCommonControlsEx with the appropriate data.

However, what bugs me a lot is that I have already used a progress bar in another application that does none of this. It is an application that I created from scratch in the same environment (VC++7.1), with the same tools (resource editor). I have checked to ensure that comctl32.lib has not been added, and I make no calls to either InitCommonControlsEx or its predecessor InitCommonControls.

My question: How is it possible to use a progress bar in a dialog without using comctl32.lib or InitCommonControls(Ex)? For once, I am actually distraught on why something is working when I think it shouldn't. :)

Thanks for any information.

Dj^Hoke
August 20th, 2004, 10:16 AM
No InitCommonControls() is Required to use a common Control ( DataView , Progress bar , etc... ) and Comctl32.lib is required to use the program in other pc without Vc++

JasonD
August 20th, 2004, 12:22 PM
Thanks for the reply.

No InitCommonControls() is Required to use a common Control ( DataView , Progress bar , etc... ) Is it possible, in any way, to use a progress bar without making any calls to InitCommonControls(Ex)?

Comctl32.lib is required to use the program in other pc without Vc++ Can you explain further? As far as I know, comctl32.lib is an import library (i.e. a library that does not contain any code) that provides the linker with information to allow dynamic linking to comctl32.dll. This means that comctl32.dll is required on any machine that the program will be run on, including the developer machine with VC++. The comctl32.lib file is only required by the linker. Am I correct?

I am at a loss why my original application compiles fine, and uses progress bars without any mention of InitCommonControls(Ex) or using comctl32.lib. Obviously, it has to be using it in some way, if the code is within comctl32.dll. But, how is it accessing it? I think I have to step away from this and come back to it with a clear mind, because I am missing something obvious.

Dj^Hoke
August 20th, 2004, 01:44 PM
Added Comctl32.lib to the list of the library in the compiler and allows to use and to distribute the program, otherwise if you go to use it in a computer where visual c++ net you have not installed the program does not work (if it uses listview etc..) you I say for personal experience

JasonD
August 20th, 2004, 04:29 PM
Dj^Hoke, the program will not even compile without comctl32.lib added to list of libraries ('Additional Dependencies'), since the InitCommonControls(Ex) function requires it. Therefore, without it, you could never give it out to anyone, unless you want to give away your source code.

What I would like to know is if I could use a dialog box without ever calling the InitCommonControls(Ex) function (and thus, not need comctl32.lib).