Register Window class in Constructor

This is a discussion on Register Window class in Constructor within the Windows Programming forums, part of the Platform Specific Boards category; Hello. I have class witch creates a child window, I don`t subclass it, just create new class for that windows, ...

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    20

    Register Window class in Constructor

    Hello.
    I have class witch creates a child window, I don`t subclass it, just create new class for that windows, and I wonder if I create window class in class constructor is it good and racional? thank you C ya
    Butterfly sweep can make torando in another side of world

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    You can create the window class in the constructor, but you need to ensure you do it only once for all instances, because you may register a window class only once. As you may create more than one instance of the class (and don't you dare just assume you won't! ), the check is important.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Sep 2004
    Posts
    20

    Thnx

    Roger that! (:
    Butterfly sweep can make torando in another side of world

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. deriving classes
    By l2u in forum C++ Programming
    Replies: 12
    Last Post: 01-15-2007, 04:01 PM
  2. opengl help
    By heat511 in forum Game Programming
    Replies: 4
    Last Post: 04-05-2004, 01:08 AM
  3. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 06:18 AM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM

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