OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Adding Pointers To Interface Objects

To add a pointer to an interface object to your TView-derived class, add the member to the new class and instantiate the object in the view class's constructor.

Access to the interface object's data and function members is through the pointer.

The advantage of this method is that it lets you easily attach and detach different interface objects. It also lets you use different types of interface objects by making the pointer a pointer to a common base class of the different objects you might want to use. For example, you can use most kinds of interface objects by making the pointer a TWindow *.

The disadvantage of this method is that event handling must go through either the interface object or the application first. This basically forces you to either use a derived interface object class to add your own event-handling functions that make reference to the view object, or handle the events through the application object. Either way, you decrease your flexibility in handling events.