OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Initializing the Control

A control object's interface element is automatically created by the SetupWindow member function inherited by the parent window object.

Make sure that when you derive new window classes, you call the base class's SetupWindow member function before attempting to manipulate its controls (for example, by calling control object member functions, sending messages to those controls, and so on).

You must not initialize controls in their parent window object's constructor. At that time, the controls' interface elements have not yet been created. Here's a typical SetupWindow:

void TMyWindow::SetupWindow()
{
TWindow::SetupWindow(); //Lets TWindow create any child controls
list1->AddString("Item 1");
list1->AddString("Item 2");
}

See Also