A SERVICE OF

logo

Handles the standard File menu command events CM_FILENEW,
CM_FILEOPEN, CM_FILESAVE, CM_FILESAVEAS, CM_FILECLOSE,
and optionally CM_FILEREVERT
P ovides the file selection interfacer
T support the Doc/View model, a document manager must be attached too
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:
class TMyApp : public TApplication
{
public:
TMyApp() : TApplication() {}
void InitMainWindow() {
.
.
.
SetDocManager(new TDocManager(dmMDI | dmMenu));
.
.
.
}
};
Y u can set the document manager to a new object using theo
SetDocManager function. SetDocManager takes a TDocManager & and returns
void.
The document manager’ public data and functions can be accesseds
through the document’ GetDocManager function. GetDocManager takes nos
parameters and returns a TDocManager &. The document manager provides
the following functions for creating documents and views:
CreateAnyDoc presents all the visible templates, whereas the
TDocT mplate member function CreateDoc presents only its own template.e
CreateAnyView filters the template list for those views that support the
current document and presents a list of the view names, whereas the
TDocT mplate member function CreateView directly constructs the viewe
specified by the document template class.
Specialized document managers can be used to support other needs. For
example, an OLE 2.0 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 interface with the appropriate OLE support.
Chapter 9, Doc/View objects
205