You’ve already added much OLE server support to the application object by using the Full-server version of Scribble.cpp. In the next two procedures, you’ll complete this process by adding a COleTemplateServer data member to CScribbleApp
and by adding a string resource to Scribble’s string table.
Note For these procedures, you will be working in Scribble itself, not in Scratch/Scribble.
To add a COleTemplateServer data member to CScribbleApp
CScribbleApp
declaration in Scribble.h and add the following lines at the beginning of the // Implementation section: COleTemplateServer m_server;
// Server object for document creation
You will find the same code in Scratch\Scribble.h, which was provided by AppWizard.
The COleTemplateServer object is used to register a server application with OLE. See how m_server
is used in Scribble’s InitInstance
.
To copy the string resource
IDP_OLE_INIT_FAILED
from the Full-server version of Scribble to your Scribble project’s String table.
This AppWizard provided string is used in Scribble’s InitInstance
. The string text is:
OLE initialization failed. Make sure that the OLE libraries are correct version.
You can view this text by selecting the string and then clicking Properties from the View menu.