Like Tree1Likes
  • 1 Post By Joose

Computer not recognizing INITCOMMONCONTROLSEX

This is a discussion on Computer not recognizing INITCOMMONCONTROLSEX within the Windows Programming forums, part of the Platform Specific Boards category; Hi, Though I've found a little bit of discussion about this issue online, nothing I've seen has solved the problem. ...

  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    10

    Computer not recognizing INITCOMMONCONTROLSEX

    Hi,
    Though I've found a little bit of discussion about this issue online, nothing I've seen has solved the problem.

    Basically the debugger is stopping at
    INITCOMMONCONTROLSEX cc;

    and saying it doesn't recognize the 'function' INITCOMMONCONTROLSEX. But it should be in <commctrl.h>, correct?

    One suggestion I've seen is to go into the commctrl.h file and change some code. But where would you find this file? A search of all files (I'm using CodeBlocks) yields nothing.

    I've checked in the Build options and found that comctl32 is included under the list of Link libraries. If that is relevant.

    Code:
    #include <windows.h>
    #include <commctrl.h>
    #include <stdio.h>
    
    
    LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
    
    
    
    char szWinName[]= "MyWin";
    
    HINSTANCE hInstance;
    HWND hwnd;
    HWND hTabWnd;
    
    
    
    
    int WINAPI WinMain (HINSTANCE hThisInstance,
                         HINSTANCE hPrevInstance,
                         LPSTR lpszArgst,
                         int nWinMode)
    {
        HWND hwnd;               
        MSG messages;            
        WNDCLASSEX wcl;
       INITCOMMONCONTROLSEX cc;
    
    
        wcl.cbSize = sizeof (WNDCLASSEX);
        
        wcl.hInstance = hThisInstance;
        wcl.lpszClassName = szWinName;
        wcl.lpfnWndProc = WindowProcedure;      
        wcl.style = CS_DBLCLKS;                 
    
    
       
        wcl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
        wcl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
        wcl.hCursor = LoadCursor (NULL, IDC_ARROW);
        wcl.lpszMenuName = NULL;                
        wcl.cbClsExtra = 0;                      
        wcl.cbWndExtra = 0;                      
       
        wcl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
    
       
        if (!RegisterClassEx (&wcl))
            return 0;
    
       
        hwnd = CreateWindowEx (
               0,                   
               szClassName,         
               "Basic Tab Controls Demo",      
               WS_OVERLAPPEDWINDOW, 
               CW_USEDEFAULT,       
               CW_USEDEFAULT,       
               544,                
               375,                
               HWND_DESKTOP,        
               NULL,                
               hThisInstance,       
               NULL                 
               );
    
       
        ShowWindow (hwnd, nWinMode);
    
       
        while (GetMessage (&messages, NULL, 0, 0))
        {
            
            TranslateMessage(&messages);
            /* Send message to WindowProcedure */
            DispatchMessage(&messages);
        }
    
       
        return messages.wParam;
    }
    This is all pretty standard stuff, just included it in case there is something obvious I'm not catching here.

    Thanks for any suggestions.

  2. #2
    Registered User
    Join Date
    Mar 2013
    Posts
    7
    Used in CodeBlocks:

    #if defined __MINGW_H
    #define _WIN32_IE 0x400
    #endif
    #include <commctrl.h>

    Linked libcomctl32.a
    stahta01 likes this.

  3. #3
    Registered User
    Join Date
    Feb 2013
    Posts
    10
    Hi,
    Thanks Joose, it worked!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SDL not recognizing collisions
    By bijan311 in forum C++ Programming
    Replies: 4
    Last Post: 05-28-2010, 06:54 PM
  2. InitCommonControlsEx not working in dev-c++
    By jayapalchandran in forum Windows Programming
    Replies: 1
    Last Post: 08-26-2006, 07:27 AM
  3. InitCommonControlsEx and Dev-cpp
    By minesweeper in forum Windows Programming
    Replies: 2
    Last Post: 12-30-2003, 08:21 PM
  4. EXE recognizing location
    By CodeMonkey in forum C++ Programming
    Replies: 6
    Last Post: 08-23-2002, 01:01 AM
  5. Recognizing Spaces
    By BigSter in forum C++ Programming
    Replies: 4
    Last Post: 05-25-2002, 01:17 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21