OWLNext 7.0
Borland's Object Windows Library for the modern age
|
After you have constructed a window object, you need to tell Windows to create the associated interface element.
Do this by calling the object's TWindow::Create() member function,
Create does the following things:
An application's main window is automatically created by TApplication::InitInstance(). You do not need to call Create yourself to create the main window. C++ exceptions can be thrown while creating a window object's interface element. You should therefore enclose calls to Create within a try/catch block to handle any memory or resource problems your application might encounter. Create throws a TXWindow exception initialized with an IDS_WINDOWCREATEFAIL when the window cannot be created or an IDS_CLASSREGISTERFAIL when the window class cannot be registered. SetupWindow throws a TXWindow exception initialized with an IDS_CHILDCREATEFAIL when a child window in the window cannot be created. These exceptions are usually caused by insufficient memory or other resources.
Here is an example of using exceptions to catch an error while creating a window object: