Thread: Is comctl32.lib required for progress bar controls?

  1. #1
    jasondoucette.com JasonD's Avatar
    Join Date
    Mar 2003
    Posts
    278

    Is comctl32.lib required for progress bar controls?

    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.

    (P.S. I already posted this to another forum, but no one was able to help me)

  2. #2
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Are you using any 3rd party libs? Maybe you are calling InitCommonControls(Ex) through some 3rd-party function?

    Anyway do you still have your original VC++ project (the one that somehow doesn't link to comctl32.lib)? Maybe you could zip it up and post it somewhere for us to download.

  3. #3
    jasondoucette.com JasonD's Avatar
    Join Date
    Mar 2003
    Posts
    278
    Dante, thanks for the reply.

    No, I am not using any 3rd party libs. I have searched every function (that my programming team created) of the entire project, and InitCommonControls(Ex) is nowhere to be found. The rest of the functions are just the standard libraries that accompany VC++ 7.1 (2003), so there's nothing fishy going on anywhere.

    I cannot zip up the code and post it because it is a commercial product. I would never expect (or ask) anyone to go through my code, anyway. I think I am going to have continually strip down the program until I can find what causes this. If this proves futile, then I could zip up what little code remains for someone to inspect.

    I guess what I am asking here is this: Is it possible to link to comctl32.lib without adding it to 'Additional Dependencies' under the 'Linker' tab within VC++? Is it possible it could be linked without my knowing?

    I just thought, maybe this has something to do with WINVER targeting a recent OS. Unlikely, but I will check it out, and see.

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    #pragma comment(lib, "comctl32.lib") will cause it to be linked in.

    MFC headers contain this.

    gg

  5. #5
    jasondoucette.com JasonD's Avatar
    Join Date
    Mar 2003
    Posts
    278
    Thanks for the info, Codeplug. I am not using MFC, though. It is just a pure Win32 application, so this could not be the problem. Unless it is possible that these MFC headers are being accessed in some way that I do not know about...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  2. beach bar (sims type game)
    By DrKillPatient in forum Game Programming
    Replies: 1
    Last Post: 03-06-2006, 01:32 PM
  3. NAQ: Everything you never wanted to know about CPP
    By evildave in forum C Programming
    Replies: 21
    Last Post: 12-12-2005, 10:56 AM
  4. color edit control's scroll bar
    By w4ck0z in forum Windows Programming
    Replies: 4
    Last Post: 10-22-2004, 02:02 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM