77.1.2 The MCI Programming Interfaces

MCI provides two programming interfaces: the command-string interface and the command-message interface.

77.1.2.1 The Command-String Interface

The command-string interface allows you to use English-language commands to communicate with MCI devices. For example, the following command string plays a WAVE file named “TIMPANI.WAV”:

play timpani.wav

The command-string interface is designed to be used with high-level programming and authoring environments such as Microsoft Visual Basic and Asymetrix ToolBook. Applications providing a text-based interface to let users control MCI devices should use the command-string interface.

77.1.2.2 The Command-Message Interface

The command-message interface uses a message-passing paradigm to communicate with MCI devices. For example, the following code fragment performs the same operation as the previous command-string example:

mciSendCommand(wDeviceID, /* device ID */

MCI_PLAY, /* command message */

0, /* flags */

(DWORD) (LPVOID) &mciPlayParms); /* parameter block */

The command-message interface is designed to be used by applications requiring a C-language interface to control multimedia devices. Applications that directly control multimedia devices should use the command-message interface.