OWLNext 7.0
Borland's Object Windows Library for the modern age
|
As a standard procedure, you should avoid overriding TDocument functions that are not declared virtual.
The document manager addresses all TDocument-derived objects as if they were actually TDocument objects. If you override a nonvirtual function, it is not called when the document manager calls that function. Instead, the document manager calls the TDocument version of the function. But if you override a virtual function, the document manager correctly calls your class's version of the function.
The following functions are declared virtual in TDocument:
TDocument::~TDocument | TDocument::IsDirty |
TDocument::AttachStream | TDocument::IsOpen |
TDocument::CanClose | TDocument::Open |
TDocument::Close | TDocument::OutStream |
TDocument::Commit | TDocument::Revert |
TDocument::DetachStream | TDocument::RootDocument |
TDocument::GetProperty | TDocument::SetDocPath |
TDocument::InStream | TDocument::SetTitle |
You can override these functions to provide your own custom interpretation of the function. But when you do override a virtual function, be sure to find out what the base class function does. When the base class performs some sort of essential task, call the base class version of the function from your own function. For example, the base class versions of many functions perform a check of the document's hierarchy, including checking or notifying any child documents, all views, any open streams, and so on.