#include <commctrl.h> gives me errors

This is a discussion on #include <commctrl.h> gives me errors within the Windows Programming forums, part of the Platform Specific Boards category; Hey, I have a weird problem when I #include <commctrl.h>.... Here is what the compiler (MSVC 2008) tells me. Code: ...

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    96

    #include <commctrl.h> gives me errors

    Hey, I have a weird problem when I #include <commctrl.h>....

    Here is what the compiler (MSVC 2008) tells me.

    Code:
    C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\commctrl.h(19) : error C20
    59: syntax error : 'return'
    C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\prsht.h(97) : error C2065:
     'CALLBACK' : undeclared identifier
    C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\prsht.h(97) : error C2065:
     'LPFNPSPCALLBACKA' : undeclared identifier
    C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\prsht.h(97) : error C4430:
     missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\prsht.h(97) : fatal error
    C1903: unable to recover from previous error(s); stopping compilation
    NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\bin
    \cl.EXE"' : return code '0x2'
    Stop.
    Huh?


    I should probably mention that this header gets included more than once, but in different compilation units (I think that is the right term).

    Like so:

    Application.cpp
    Code:
    #include <commctrl.h>
    
    code...
    Notebook.cpp
    Code:
    #include <commctrl.h>
    
    code....

  2. #2
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    Have you <windows.h> included too?

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    96
    Quote Originally Posted by twomers View Post
    Have you <windows.h> included too?
    Yeah in Application.cpp, but not in Notebook.cpp.

    Are you saying I have to #include <windows.h> before <commctrl.h>?

    EDIT:

    Ok I just did that and it works now. :P

    Why on earth do I have to do that?

  4. #4
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    You probably know this, but because you asked anyway, commctrl.h depends upon windows.h.

  5. #5
    Registered User
    Join Date
    Aug 2005
    Posts
    96
    Quote Originally Posted by MacGyver View Post
    You probably know this, but because you asked anyway, commctrl.h depends upon windows.h.
    Ok, so it needs windows.h, but doesn't include it? LOL

    Typical.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Socket programming
    By kahad in forum C Programming
    Replies: 3
    Last Post: 12-14-2006, 04:37 PM
  2. Compiler errors
    By Dark_Phoenix in forum Game Programming
    Replies: 2
    Last Post: 11-05-2006, 10:28 AM
  3. MFC include BS
    By VirtualAce in forum Windows Programming
    Replies: 4
    Last Post: 10-31-2005, 12:44 PM
  4. OpenGL camera errors..can't find 'em!?
    By psychopath in forum Game Programming
    Replies: 12
    Last Post: 04-22-2004, 07:17 PM
  5. help with finding lowest number entered
    By volk in forum C++ Programming
    Replies: 12
    Last Post: 03-22-2003, 01:21 PM

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