There are two MCI interfaces you can use to communicate with MCI devices: command-message functions and command-string functions. You can use either set of functions to access all MCI device capabilities. The difference between the two interfaces is in their basic command structure and the method in which they pass information to devices.
The command-message interface uses messages to control MCI devices. A bit-vector of flags and a pointer to a data structure is sent with each message. The flags and information data structure let an application send information to a device and receive returned data. MCI passes device messages and information directly to the device.
The command-string interface uses text commands to control MCI commands. Text strings contain all the information needed to execute a command. MCI parses the text string and translates it into the message, flags, and data structure that is then sent to the command-message interface. Because of this process, this interface is slightly slower than the command-message interface.
Summary: Choosing Between Functions
Each interface has unique properties you can use in your application. The command-message interface is more versatile if your application controls an MCI device directly. If this is the case, your application can directly and easily manipulate and decode data used by this interface. For example, your application can play an audio or video segment when a user successfully completes a task. The MCI examples in the audio and animation chapters of this workbook use the command-message interface to control MCI devices.
The command-string interface should be selected if your application uses a text-based interface to let the user control an MCI device. In such an application, the user can easily read and create the necessary command strings. For example, your application might read a user-written script that controls MCI devices. The MCI commands in the script can be sent directly to MCI without intermediate processing by your application.