General global bool variables?

This is a discussion on General global bool variables? within the Windows Programming forums, part of the Platform Specific Boards category; I know there is a lot of discussion on global variables and that they are EVIL! I have been using ...

  1. #1
    Registered User Bajanine's Avatar
    Join Date
    Dec 2001
    Location
    The most peaks over 10,000 feet!
    Posts
    396

    General global bool variables?

    I know there is a lot of discussion on global variables and that they are EVIL!

    I have been using global boolean variables to keep track of which menu options are enabled or disabled (grayed).

    Is there a better method, and if so what is it?
    Favorite Quote:

    >For that reason someone invented C++.
    BLASPHEMY! Begone from my C board, you foul lover of objects, before the gods of C cast you into the void as punishment for your weakness! There is no penance for saying such things in my presence. You are henceforth excommunicated. Never return to this house, filthy heretic!



  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    One solution is to declare the variables in one of the classes such as the document class.

    Kuphryn

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Couldn't you use the API IsWindowEnabled() ?

    Code:
    BOOL IsWindowEnabled(
      HWND hWnd   // handle to window
    );
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

  4. #4
    Registered User Bajanine's Avatar
    Join Date
    Dec 2001
    Location
    The most peaks over 10,000 feet!
    Posts
    396
    Thanks for the info. I'll look into your suggestions.
    Favorite Quote:

    >For that reason someone invented C++.
    BLASPHEMY! Begone from my C board, you foul lover of objects, before the gods of C cast you into the void as punishment for your weakness! There is no penance for saying such things in my presence. You are henceforth excommunicated. Never return to this house, filthy heretic!



Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM
  2. DirectInput help
    By Muphin in forum Game Programming
    Replies: 2
    Last Post: 09-10-2005, 12:52 PM
  3. Headers that use each other
    By nickname_changed in forum C++ Programming
    Replies: 7
    Last Post: 10-03-2003, 05:25 AM
  4. Can someone help me with this console app please?
    By Marcos in forum C++ Programming
    Replies: 4
    Last Post: 07-26-2003, 08:04 PM
  5. global variables - okay sometimes...?
    By MadHatter in forum C++ Programming
    Replies: 21
    Last Post: 01-21-2003, 04:23 PM

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