Trying Out the Newly Created OLE Container Application

AppWizard provides a starter OLE container application that already has a lot of the underlying architecture that most OLE container applications need. Build this new AppWizard-provided application and try it out.

To build the starter OLE container application

This builds the default version of the container application, producing the file Container.exe under your project directory.

At this point, Container already has many of the features you saw in the preview of the completed Container application, but it is missing several capabilities, such as:

You will add this and other functionality during this lesson. First see for yourself the built-in capabilities of the starter Container application.

Note   Before you can preview the Container application using Scribble, you need to register Scribble as described in Registering an OLE Component Application earlier in this lesson.

To create a new Scribble drawing within Container

  1. On the Edit menu, click Insert New Object.

  2. In the Insert Object dialog box, select Scribb Document from the Object Type list box.

  3. Click OK.

    A new Scribble object is activated in place. No additional code is required to implement the Insert New Object command on the Edit menu.

    Notice how Container’s menu is merged with Scribble’s and how Container’s toolbar is replaced by one provided by Scribble. Again, this is already working so no additional code is required here.

To edit the in-place activated object

  1. Drag the mouse to draw in the embedded Scribble object.

  2. Try out Scribble’s menu and toolbar commands in place, such as the Pen Width command.

  3. Press ESC to deactivate the Scribble object.

    Notice that the user interface (ESC) for canceling in-place editing mode for the selected object is already incorporated into the starter AppWizard-created application.

  4. Click the Scribble object to reactivate it.

  5. On the Edit menu, point to Scribb Object, and then click Edit.

    Edit activates the object in place inside the container. (Open fully opens the Scribble server in its own window.)

    Note that the Scribble server provides the tracker rectangle; Container provides the tracker only when the object is not activated in place.

  6. Exit Container.

The AppWizard-provided container application already has a lot of OLE container functionality, but it is still missing some basics that are implemented in the remainder of this tutorial.