Previewing Scribble Running as an OLE Server

Before working through the steps of adding OLE server support to Scribble, try out the completed application. This will help you appreciate how Scribble behaves when it is activated by an ActiveX container.

The ActiveX container application you will use is the completed Container tutorial project (you’ll build it from the source files). Before you can view Scribble (the server application) files from within Container, you must register Scribble as an OLE server application.

To install and register Scribble as an OLE server application

Build and run Scribble.exe from the sample source files for Step 7:

  1. Go to the SCRIBBLE sample abstract in the documentation.

  2. Click STEP7.

  3. In the Sample Application dialog box, click Copy All.

  4. Accept the default directory.

  5. Open the project in the development environment.

  6. From the Build menu, click Execute Scribble.exe.

  7. When prompted to build the application, click Yes.

    Running Scribble briefly as a stand-alone application registers it in the system registry as an OLE server.

Note   You can find a finished example of this lesson's code in the Scribble Step7 sample source code directory.

To preview the Container project as an ActiveX container application

  1. Go to the CONTAINER sample abstract in the documentation.

  2. From Step 2, copy the sample files to your hard drive.

  3. Build and run Container.exe.

  4. From Container’s Edit menu, click Insert New Object.

    The Insert Object dialog box appears.

  5. In the Object Type list, click Scribb Document.

    This opens a Scribble document inside the Container application. Notice how Scribble:

  6. Draw something in Scribble’s in-place window.

    Notice how drawing in Scribble’s in-place window is just like drawing in the stand-alone Scribble application.

  7. Click outside the window.

    With focus taken away so the Scribble document is no longer selected, the Scribble object is redrawn inside Container’s view with the help of the Scribble server.

The rest of this lesson describes how to make Scribble an OLE server.