Thread: initcommoncontrolex question

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    8

    initcommoncontrolex question

    I am making a status bar in my application and I was wondering which way was the correct way to initiate the common control function. Here are the two ways I'm using

    Code:
    INITCOMMONCONTROLSEX InitC;
    InitC.dwSize=sizeof(INITCOMMONCONTROLSEX);
    InitC.dwICC = ICC_BAR_CLASSES;
    
    InitCommonControlsEx(&InitC);
    or

    Code:
    InitCommonControlsEx(NULL);
    Both ways work. Which way is the correct way? Thanks.

  2. #2
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    639
    If the docs don't say that the parameter is optional or that NULL is an acceptable value, then the function will generally fail. The second method doesn't really work (it'll return FALSE) but your program still works because at the current time InitCommonControlsEx is called internally when the dll loads.

    Use the first and you won't go wrong.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alice....
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 06-20-2005, 02:51 PM
  2. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM