InitCommonControlsEx and Dev-cpp

This is a discussion on InitCommonControlsEx and Dev-cpp within the Windows Programming forums, part of the Platform Specific Boards category; Hi, I am trying to get a program that I wrote in MSVC to work in Dev-cpp (I don't have ...

  1. #1
    Funniest man in this seat minesweeper's Avatar
    Join Date
    Mar 2002
    Posts
    801

    InitCommonControlsEx and Dev-cpp

    Hi,

    I am trying to get a program that I wrote in MSVC to work in Dev-cpp (I don't have my MSVC with me at the mo).

    I just can't get InitCommonControlsEx to work. I have:

    Code:
    #include <commctrl.h>
    Code:
    INITCOMMONCONTROLSEX iccx;
            TBADDBITMAP          tbab, tbabmove;
            TBBUTTON             tbb[5];
    		TBBUTTON			 tbbmove [6];
            //first load in the common controls dll, specifying the toolbar control wnd class
            iccx.dwSize = sizeof(INITCOMMONCONTROLSEX);
            iccx.dwICC = ICC_BAR_CLASSES;
            InitCommonControlsEx(&iccx);
    and

    '-lcomctl32' written in the 'linker' box on the 'parameters' tab of the project option dialog box.

    When I compile I just get :


    2028 C:\Program Files\Apache Group\Apache2\Personal Organiser\Address Book.cpp
    `INITCOMMONCONTROLSEX' undeclared (first use this

    2033 C:\Program Files\Apache Group\Apache2\Personal Organiser\Address Book.cpp
    `iccx' undeclared (first use this function)

    2035 C:\Program Files\Apache Group\Apache2\Personal Organiser\Address Book.cpp
    `InitCommonControlsEx' undeclared (first use this
    I even went into commctrl.h and copy and pasted:

    Code:
    typedef struct tagINITCOMMONCONTROLSEX {
    	DWORD dwSize;
    	DWORD dwICC;
    } INITCOMMONCONTROLSEX,*LPINITCOMMONCONTROLSEX;
    and

    Code:
    BOOL WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX);
    into my .cpp file (I was desperate at this point). It then compiled but I just got a linker error (InitCommonControlsEx@0)

    edit: also, my compile include paths are the correct ones i.e. c:\DEV-CPP\include etc. I didn't install it into a different directory.

    Anyone got any suggestions? Thanks


    Bring back MSVC
    Last edited by minesweeper; 12-30-2003 at 07:57 PM.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,674
    From my Dev-Cpp commctrl.h file:
    Code:
    #ifndef _WIN32_IE
    /* define _WIN32_IE if you really want it */
    #if 0
    #define _WIN32_IE	0x0300
    #endif
    #endif
    ...
    #if (_WIN32_IE >= 0x0300)
    typedef struct tagINITCOMMONCONTROLSEX {
    	DWORD dwSize;
    	DWORD dwICC;
    } INITCOMMONCONTROLSEX,*LPINITCOMMONCONTROLSEX;
    #endif
    As for the linker error...did you extern "C" {} your desperate declaration of InitCommonControlsEx()?

    gg

  3. #3
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Code:
    #define _WIN32_IE 0x0400 /* min */
    #include <commctrl.h>
    For code that uses common controls intended for MinGW compilation I normally use:
    Code:
    #if defined __MINGW_H
    #define _WIN32_IE 0x0400
    #endif
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. strange problem with dev cpp
    By henrychan22 in forum C++ Programming
    Replies: 8
    Last Post: 06-18-2006, 11:05 AM
  2. Linker error in Dev Cpp (DX)
    By C+noob in forum Game Programming
    Replies: 2
    Last Post: 08-15-2005, 03:13 AM
  3. New to Dev C++/<windows.h>...
    By Cilius in forum C++ Programming
    Replies: 3
    Last Post: 02-23-2005, 12:05 AM
  4. Glut and Dev C++, Programs not Quitting?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-29-2004, 07:43 PM
  5. dev cpp documentation
    By sanchezero in forum Game Programming
    Replies: 2
    Last Post: 06-18-2002, 02:32 PM

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