Add OLE Menu Resources

A server application shows different menus, depending on whether it is running stand-alone, embedded, or in-place activated. AppWizard provides three different menus for these cases:

Scribble’s two distinct OLE-related menu resources are referred to in Scribble.cpp in CScribbleApp::InitInstance:

pDocTemplate->SetServerInfo(
   IDR_SCRIBBTYPE_SRVR_EMB, IDR_SCRIBBTYPE_SRVR_IP,
   RUNTIME_CLASS(CInPlaceFrame));

AppWizard provides all the code and resources described above, except for the Pen pop-up menu, which is application specific. If you are creating a new application from scratch, each new pop-up menu must be added to each of the three resources. This is easy to do with the drag and copy feature of the Menu editor. You can copy a resource by dragging it to the desired location while holding down the CTRL key and then releasing the mouse button.

In this part of the tutorial, you will:

To copy menu resources

  1. Switch to ResourceView and expand the Scribble Resources folder, then expand the Menu folder.

  2. From the File menu, click Open and select Scratch\Scribble\Scribble.rc. Again, expand the Menu folder.

  3. Copy the menus IDR_SCRIBBTYPE_SRVR_EMB and IDR_SCRIBBTYPE_SRVR_IP from the scratch resource file to your Scribble project .RC file.

  4. Close the scratch version of Scribble.rc.

To copy menu items

  1. Open the menu resources IDR_SCRIBBTYPE and IDR_SCRIBBTYPE_SRVR_EMB in your Scribble project resource file.

  2. Arrange the two menus so they don’t overlap and so you can see both of them in the Menu editor window.

  3. Copy the Pen menu from IDR_SCRIBBTYPE into the IDR_SCRIBBTYPE_SRVR_EMB menu so that it is between the Edit and View menus, as in IDR_SCRIBBTYPE.

  4. Copy the Clear All menu item from the Edit menu in IDR_SCRIBBTYPE to the Edit menu in IDR_SCRIBBTYPE_SRVR_EMB.

  5. Close IDR_SCRIBBTYPE_SRVR_EMB and repeat steps 1 to 3 for IDR_SCRIBBTYPE_SRVR_IP, placing the Pen menu as follows:

    Edit | Pen | View | |   |  | Help

    (Don’t copy the Clear All menu item.)

  6. Save and then close the menu resources.