OWLNext 7.0
Borland's Object Windows Library for the modern age
|
The document manager, an instance of TDocManager or a TDocManager-derived class, performs a number of tasks:
To support the Doc/View model, a document manager must be attached to the application. This is done by creating an instance of TDocManager and making it the document manager for your application. The following code shows an example of how to attach a document manager to your application:
You can set the application document manager to a new object using the TApplication::SetDocManager() function, which takes a TDocManager* and returns a pointer to the old document manager.
Note that there are two SetDocManager functions, TApplication::SetDocManager() and TDocument::SetDocManager(). These functions have different signatures and member functions. Do not confuse them.
The document manager's public data and functions can be accessed through the document's GetDocManager function. GetDocManager takes no parameters and returns a TDocManager&. The document manager provides the following functions for creating documents and views:
Specialized document managers can be used to support other needs. For example, an OLE 2 server needs to support class factories that create documents and views through interfaces that are not their own. If the server is invoked with the Embedded command-line flags, it doesn't bring up its own user interface and can attach a document manager that replaces the user interface with the appropriate OLE support.