Add OLE Server Support to the Application Object

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.

Suggested Reading

To add a COleTemplateServer data member to CScribbleApp

To copy the string resource

  1. Switch to ResourceView and open Scribble’s String table.

  2. Use the File menu to open the .RC file for the Scratch\Scribble project, and open its String table. (Don’t insert this resource file.)

  3. Arrange the String editor windows so that you can view both String tables and they don’t overlap.

  4. Press CTRL and then drag the 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.

  5. Save your Scribble.rc and close both String tables. (You can also close the Scratch\Scribble version of Scribble.rc.)