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

To find the current application object from a window object, TWindow has a member function, TWindow::GetApplication(), that returns a pointer to the application object.

You can use this pointer to call TApplication member functions and access TApplication data members. The following listing shows a possible use of GetApplication:

void TMyWindow::Error()
{
// display message box containing the application name
MessageBox("An error occurred!", GetApplication()->Name, MB_OK);

}