appel all instances of a class
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: appel all instances of a class

  1. #1
    Join Date
    Jan 2011
    Posts
    1

    Wink appel all instances of a class

    hello,
    i'm new here and have a (banal) question:
    i'm creating a GUI-enviroment with opengl and have a button-class.
    i want to do a button-click-test, but i need a method to say to this function that it has to check EVERY created instance of this button-class.
    i tried to find something via google, but nothing.
    does anybody know a solution?? for instance with dynamic reservation??

    thank you very very much in advance

    ::Codeblocks::

    ps: i need only the general answer, i've already created the graphics function.
    **if it will work i'll post my project for all***
    super-beautiful buttons ;-)

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,891

    Re: appel all instances of a class

    It's possible to track all created instances of a class using a static class member which gets manipulated in the constructor(s) and destructor. Don't forget you'll need to explicitly define the copy constructor if you haven't already, and thread safety is going to be an issue.

    However, if I were faced with such a requirement I would seriously re-think my design, as such things are usually an indication that something is wrong with it.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center