Creating Custom Viewer Commands

As explained in Chapter 18, “Multimedia Viewer Commands,” you can use the RegisterRoutine Viewer command to register any DLL function as a Viewer command. You might want to create a DLL whose sole purpose is to provide new Viewer commands for authors' use. This section will show you how.

Examples in this section use the source code in the DLLDEMO.C file provided with Viewer. DLLDEMO.C contains a HelloWorld function, which plays a beep on the speaker.

You will also find a small Viewer title called DLLDEMO.MVB, along with the source file DLLDEMO.RTF and project file DLLDEMO.MVP used to build it. HelloWorld is registered as a Viewer command in DLLDEMO.MVP, and the following hot spot in the DLLDEMO.MVB title executes HelloWorld to play a beep.

Call HelloWorld.!HelloWorld(hwndapp,qchPath)

Note:

To debug your DLL or observe any of the operations described in this section, you can compile DLLDEMO for the CodeView for Windows symbolic debugger and load the DLL into CodeView while you view the sample title. See the DLLDEMO.C file for specific instructions.