Calling Viewer Internal Functions

Viewer provides DLL authors with access to 16 of its internal functions. These functions perform operations in the internal .MVB file system, get global information about the currently open title, or display information in a standard Viewer dialog box. They are documented in the DLL.H header file provided with Viewer.

In this section, you'll learn how to access six of these internal functions. An overview of the mechanism is as follows:

1.Viewer sends a DW_WHATMSG message to the DLL.

2.The LDLLHandler function in the DLL processes the DW_WHATMSG message by returning a DC_CALLBACKS flag.

3.Viewer sends a DW_CALLBACKS message specifying a pointer to an array of Viewer internal functions.

4.The LDLLHandler function uses the pointer passed in the DW_CALLBACKS message to obtain pointers to the Viewer functions it will use.

The ExportBag function in the sample file DLLDEMO.C is used for the examples in this section. ExportBag copies a file from the .MVP internal file system to a MS-DOS file. (The file from the .MVP file system is initially stored using an entry in the [BAGGAGE] section of the DLLDEMO.MVP project file.) You can use the mechanism illustrated in this example to access files stored in any .MVB file system.