Registering class instances for to be controlled by a class's function
<p>Hehe I'm having hard time on choosing the question title. But let me explain about my problem to make it clearer.</p>

<p>I'm now writing my own GUI library for my game in C++ with a DirectX wrapper out there.
But I got no idea on how to render my in-game windows by just calling the "manager" class's draw function.</p>

<p>For example, say I have a "manager" and "window" class already.</p>

<p>the manager:</p>

<pre>class MyGUIManager
{
private:
  std::vector&lt;MyGUIWindow&gt; WindowCollector;
public:
  MyGUIManager()
  {
  }
  virtual MyGUIWindow *NewWindow(char *szWindowTitle)
  {
    MyGUIWindow *temp = new MyGUIWindow();
    temp->SetWindowTitle(szWindowTitle);
    return temp;
  }
  void RegisterWindow(MyGUIWindow targetWindow) // hopely this 
  {
    this->WindowCollector.push_back(targetWindow);
  }
  void Draw()
  {
    // I wanted this function to be able to call all MyGUIWindow instances' Draw() function
    // can it be helped like this?
    for(int i = 0; i &lt; this->WindowCollector.size(); i++)
      this->WindowCollector.at(i)->Draw(); // but the vector members must be referenced to each window instance..
  }
};</pre>

<p>the window:</p>

<pre>
class MyGUIWindow
{
public:
  MyGUIWindow()
  {
    this->SetWindowTitle("New Window");
  }
  void SetWindowTitle(char *szWindowTitle);
  void Draw();
};</pre>

<p>and the main program:</p>

<pre>
//...
  MyGUIManager *GUIMAN = new MyGUIManager();
  MyGUIWindow *FirstWindow = GUIMAN->NewWindow("Hello World");
  MyGUIWindow *SecondWindow = GUIMAN->NewWindow("Hello World!!!");
  GUIMAN->RegisterWindow(FirstWindow); // ??
  GUIMAN->RegisterWindow(SecondWindow);

  while(Drawing())
  {
    GUIMAN->Draw(); // I wanted this function to be able to call ALL MyGUIWindow instances' Draw() function
    //...
  }</pre>

<p>so the main question is, how to make all of MyGUIWindow variables can be controlled through WindowCollector vector?</p>
