MCI命令字符串和消息


Windows Multimedia
Previous  Next

MCI命令字符串和消息
MCI Command Strings and Messages

MCI支持命令字符串和命令消息。这意味着您在MCI应用程序中既可以使用字符串也可使用消息,或者二者同时使用。
MCI supports Command Strings and Command Messages. You can use either strings or messages, or both, in your MCI application.

    命令消息接口由常量和结构体组成,使用mciSendCommand函数发送消息到MCI设备。
    The command-message interface consists of constants and structures. Use the mciSendCommand function to send messages to an MCI device.

    命令字符串接口提供命令消息的文字版本。使用mciSendString函数发送字符串到MCI设备。命令字符串与命令消息的功能是相同的。操作系统在发送命令字符串到MCI处理驱动之前,会将它们转换为命令消息。
    The command-string interface provides a textual version of the command messages. Use the mciSendString function to send strings to an MCI device. Command strings duplicate the functionality of the command messages. The operating system converts the command strings to command messages before sending them to the MCI driver for processing.

命令消息以结构体的形式获取信息,这些结构体非常容易在C程序中使用,并且可以包含关于设备的多方面信息。命令字符串以字符串的形式获取信息,但是在同一时间只能获取一个字符串。您的应用程序必须解析并测试每一个字符串。您将很快发现在某些方面,命令消息比命令字符串更易使用,然而命令字符串更易于记忆与实现。在不需要返回值的时候(除了效验是否成功),某些MCI应用程序使用命令字符串;在需要从设备获取信息的时候,某些MCI应用程序使用命令消息。
The command messages that retrieve information do so in the form of structures, which are easy to interpret in a C application. These structures can contain information on many different aspects of a device. The command strings that retrieve information do so in the form of strings, and can only retrieve one string at a time. Your application must parse or test each string to interpret it. You might find that the command messages are easier to use than the command strings in some cases, but the command strings are easy to remember and implement. Some MCI applications use command strings when the return value will not be used (other than to verify success) and command messages when retrieving information from the device.

在后续的介绍中,字符串形式的命令会在消息形式命令之后的括号中。
When commands are discussed, this overview uses the string form of the command followed by the message form in parentheses.

Previous  Next

--------------------------------------------------------------------------------

© 2005 Microsoft Corporation. All rights reserved.


posted on 2006-05-20 12:40  Timanders  阅读(1273)  评论(0)    收藏  举报

导航