Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

what is wrong with INITCOMMONCONTROLSEX?

DonotaloDonotalo Member Posts: 715
[code]#include
#include
#include
#include
#include

LRESULT CALLBACK WindowFunc (HWND, UINT, WPARAM, LPARAM);

char szWinName[] = "MyWin";

int WINAPI WinMain (HINSTANCE hThisInst, HINSTANCE hPrevInst,
LPSTR lpszArgs, int nWinMode)
{
MSG msg;
WNDCLASSEX wcl;
HACCEL hAccel;
[red]INITCOMMONCONTROLSEX cc;[/red]

wcl.cbSize = sizeof(WNDCLASSEX);
wcl.hInstance = hThisInst;
wcl.lpszClassName = szWinName;
...
[/code]
[purple]the above code is the starting of the main program. my compiler is dev c++. i've included and linked with the library "libcomctl32.a". but i'm getting the following compile time error for the line in red above:

`INITCOMMONCONTROLSEX' undeclared (first use this function)

can any one tell me why?[/purple]
[hr][purple]~Donotalo()[/purple]

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    [blue]If you open CommCtrl.h you will find this code:[/blue]
    [code]
    #if (_WIN32_IE >= 0x0300)
    typedef struct tagINITCOMMONCONTROLSEX {
    DWORD dwSize; // size of this structure
    DWORD dwICC; // flags indicating which classes to be initialized
    } INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
    [/code]
    [blue]Obviously the _WIN32_IE in your compiler is LESS THAN 0x0300 - that is why it is not defined. I suggest you include that define on the command line.[/blue]

  • DonotaloDonotalo Member Posts: 715
    : [blue]If you open CommCtrl.h you will find this code:[/blue]
    : [code]
    : #if (_WIN32_IE >= 0x0300)
    : typedef struct tagINITCOMMONCONTROLSEX {
    : DWORD dwSize; // size of this structure
    : DWORD dwICC; // flags indicating which classes to be initialized
    : } INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
    : [/code]
    : [blue]Obviously the _WIN32_IE in your compiler is LESS THAN 0x0300 - that is why it is not defined. I suggest you include that define on the command line.[/blue]
    :
    :
    [purple]i've never encountered this kind of situation and thus unable to understand ur suggestion. :-( can u please tell me in detail what i have to do to successfully compile the program?
    [/purple]
    [hr][purple]~Donotalo()[/purple]

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : : [blue]If you open CommCtrl.h you will find this code:[/blue]
    : : [code]
    : : #if (_WIN32_IE >= 0x0300)
    : : typedef struct tagINITCOMMONCONTROLSEX {
    : : DWORD dwSize; // size of this structure
    : : DWORD dwICC; // flags indicating which classes to be initialized
    : : } INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
    : : [/code]
    : : [blue]Obviously the _WIN32_IE in your compiler is LESS THAN 0x0300 - that is why it is not defined. I suggest you include that define on the command line.[/blue]
    : :
    : :
    : [purple]i've never encountered this kind of situation and thus unable to understand ur suggestion. :-( can u please tell me in detail what i have to do to successfully compile the program?
    : [/purple]
    : [hr][purple]~Donotalo()[/purple]
    :
    :
    [blue]I never used DEV C++, but there (in the build settings) should be a section for preprocessor definitions. You have to define that symbol to be 0x0300. In the C code it would have looked this way:
    [/blue]
    [code]
    #define _WIN32_IE 0x0300
    [/code]
    [blue]
    First of all try defining it before any Win32 header is compiled:
    [/blue]
    [code]
    #define _WIN32_IE 0x0300

    #include
    ... your all code here...
    [/code]

  • LundinLundin Member Posts: 3,711
    : : : [blue]If you open CommCtrl.h you will find this code:[/blue]
    : : : [code]
    : : : #if (_WIN32_IE >= 0x0300)
    : : : typedef struct tagINITCOMMONCONTROLSEX {
    : : : DWORD dwSize; // size of this structure
    : : : DWORD dwICC; // flags indicating which classes to be initialized
    : : : } INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
    : : : [/code]
    : : : [blue]Obviously the _WIN32_IE in your compiler is LESS THAN 0x0300 - that is why it is not defined. I suggest you include that define on the command line.[/blue]
    : : :
    : : :
    : : [purple]i've never encountered this kind of situation and thus unable to understand ur suggestion. :-( can u please tell me in detail what i have to do to successfully compile the program?
    : : [/purple]
    : : [hr][purple]~Donotalo()[/purple]
    : :
    : :
    : [blue]I never used DEV C++, but there (in the build settings) should be a section for preprocessor definitions. You have to define that symbol to be 0x0300. In the C code it would have looked this way:
    : [/blue]
    : [code]
    : #define _WIN32_IE 0x0300
    : [/code]
    : [blue]
    : First of all try defining it before any Win32 header is compiled:
    : [/blue]
    : [code]
    : #define _WIN32_IE 0x0300
    :
    : #include
    : ... your all code here...
    : [/code]
    :
    :


    Google-people suggest similar:

    http://cboard.cprogramming.com/showthread.php?t=82282

    Things like this make Dev annoying... there are always minor issues here and there as soon as you use the Win API.
  • DonotaloDonotalo Member Posts: 715
    : : : : [blue]If you open CommCtrl.h you will find this code:[/blue]
    : : : : [code]
    : : : : #if (_WIN32_IE >= 0x0300)
    : : : : typedef struct tagINITCOMMONCONTROLSEX {
    : : : : DWORD dwSize; // size of this structure
    : : : : DWORD dwICC; // flags indicating which classes to be initialized
    : : : : } INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
    : : : : [/code]
    : : : : [blue]Obviously the _WIN32_IE in your compiler is LESS THAN 0x0300 - that is why it is not defined. I suggest you include that define on the command line.[/blue]
    : : : :
    : : : :
    : : : [purple]i've never encountered this kind of situation and thus unable to understand ur suggestion. :-( can u please tell me in detail what i have to do to successfully compile the program?
    : : : [/purple]
    : : : [hr][purple]~Donotalo()[/purple]
    : : :
    : : :
    : : [blue]I never used DEV C++, but there (in the build settings) should be a section for preprocessor definitions. You have to define that symbol to be 0x0300. In the C code it would have looked this way:
    : : [/blue]
    : : [code]
    : : #define _WIN32_IE 0x0300
    : : [/code]
    : : [blue]
    : : First of all try defining it before any Win32 header is compiled:
    : : [/blue]
    : : [code]
    : : #define _WIN32_IE 0x0300
    : :
    : : #include
    : : ... your all code here...
    : : [/code]
    : :
    : :
    :
    :
    : Google-people suggest similar:
    :
    : http://cboard.cprogramming.com/showthread.php?t=82282
    :
    : Things like this make Dev annoying... there are always minor issues here and there as soon as you use the Win API.
    :
    [purple]thanks to both of u. problem solved. :-)
    [/purple]
    [hr][purple]~Donotalo()[/purple]

Sign In or Register to comment.