Thread: Problem recognizing TreeView constants, etc.

  1. #1
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584

    Problem recognizing TreeView constants, etc.

    In my program, I am using a Tree View control, but I'm having trouble getting it going. You see, it doesn't recognize the constants like TVINSERTSTRUCT and other parts of the Tree View.

    And since I'm using Dev-C++ to program with, I actually did link the file which I thought was what I needed for the controls like the Tree View. So I linked the file "libcomctl32.a". But, still nothing. Doesn't recognize the Tree View definitions.

    What do I do to get this going?

    Thanks!
    1978 Silver Anniversary Corvette

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    #included commctrl.h?

    #defined _WIN32_IE to a suitable value (minimum 0x0400 ) prior to including commctrl.h?

    Searched your version of commctrl.h to ensure TVINSERTSTRUCT etc. are typedef'd/defined (should also tell you how to define _WIN32_IE)?

    Got the latest win32api (2.5) for mingw from here or here?
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Yes, I included commctrl.h. But whats that _WIN32_IE about? What is it, and what is the value supposed to be? I'll search commctrl.h, but what if it doesn't have the necessary constants? What am I supposed to do?
    1978 Silver Anniversary Corvette

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Originally posted by Garfield
    But whats that _WIN32_IE about? What is it, and what is the value supposed to be?
    Read this msdn page for more information.

    Some of the common control stuff in commctrl.h is sandwiched within preprocessor conditionals: if these specific preprocessor conditions are not met then that stuff won't be typedef'd/defined, hence your compiler issuing 'undefined reference' type errors. Looking up the struct/function/define in question in the header file should tell you what you need to do. BTW, that's a general rule for 'undefined references': go to the header, check if the problem reference is defined and, if it is, meet any preprocessor requirement listed (if the reference isn't there then you'll need to update your header, which may not always be possible particularly with MinGW unless you change that particular header yourself).

    #define _WIN32_IE 0x0400 prior to including commctrl.h should get you going with most of the standard common controls stuff.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  5. #5
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Well, I searched the .h file and there is no TVINSERTSTRUCT. What now?
    1978 Silver Anniversary Corvette

  6. #6
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    You're probably using an ancient version of devcpp or, more specifically, MinGW. You can either update devcpp, get the latest stable version of MinGW (install to a different directory from your current devcpp and reconfigure devcpp to use it) or you can get the latest mingw win32api. I posted links earlier in this thread to help you find what you need. Alternatively you can just copy the latest commctrl.h directly from mingw cvs but I don't advise this latter course of action as anything other than a very temporary test-case solution. You can always update your devcpp but if you do then make sure you download the 'full version' and not just the ide itself.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  7. #7
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Okay, I'll download the full version. But what do I do to install it? It will automatically overwrite the current one? I should backup my app files before I do that too.
    1978 Silver Anniversary Corvette

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  2. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  3. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  4. Programmatically creating nodes in a treeview problem
    By DanFraser in forum C# Programming
    Replies: 2
    Last Post: 10-12-2006, 02:41 PM
  5. Problem located but not sure how to fix MouseWheel problem
    By jeppesenbrian in forum C# Programming
    Replies: 2
    Last Post: 07-01-2006, 01:43 PM