When you use an MCI structure to return integer information that also has a string equivalent, MCI needs the string ID to find it in the resource table. The high-order word of the return member is set to the string ID. The low-order word of the return member is set to the return value. You can use the MAKEMCIRESOURCE macro to combine these values. For example, the follow statement assigns information for the songpointer format to the return member:
lpStatus->dwReturn = MAKEMCIRESOURCE(MCI_SEQ_FORMAT_SONGPTR,
MCI_SEQ_FORMAT_SONGPTR_S);
Many of the return values defined in MMSYSTEM.H also have a string resource ID defined in MMDDK.H. Identifiers which are only used for return values and are not input parameters will normally have only one version (they do not have a resource identifier with the _S suffix). The following string resource IDs are defined by MMDDK.H:
String Resource ID | MCI Constant |
---|---|
MCI_FORMAT_BYTES_S | MCI_FORMAT_BYTES |
MCI_FORMAT_FRAMES_S | MCI_FORMAT_FRAMES |
MCI_FORMAT_HMS_S | MCI_FORMAT_HMS |
MCI_FORMAT_MILLISECONDS_S | MCI_FORMAT_MILLISECONDS |
MCI_FORMAT_MSF_S | MCI_FORMAT_MSF |
MCI_FORMAT_SAMPLES_S | MCI_FORMAT_SAMPLES |
MCI_FORMAT_SMPTE_24_S | MCI_FORMAT_SMPTE_24 |
MCI_FORMAT_SMPTE_25_S | MCI_FORMAT_SMPTE_25 |
MCI_FORMAT_SMPTE_30_S | MCI_FORMAT_SMPTE_30 |
MCI_FORMAT_SMPTE_30DROP_S | MCI_FORMAT_SMPTE_30DROP |
MCI_FORMAT_TMSF_S | MCI_FORMAT_TMSF |
MCI_SEQ_FILE_S | MCI_SEQ_FILE |
MCI_SEQ_FORMAT_SONGPTR_S | MCI_SEQ_FORMAT_SONGPTR |
MCI_SEQ_MAPPER_S | MCI_SEQ_MAPPER |
MCI_SEQ_MIDI_S | MCI_SEQ_MIDI |
MCI_SEQ_NONE_S | MCI_SEQ_NONE |
MCI_SEQ_SMPTE_S | MCI_SEQ_SMPTE |
MCI_VD_FORMAT_TRACK_S | MCI_VD_FORMAT_TRACK |
MIDIMAPPER_S | MIDIMAPPER |
WAVE_FORMAT_PCM_S | WAVE_FORMAT_PCM |
WAVE_MAPPER_S | WAVE_MAPPER |
MCI uses the high-order word of the DriverProc return value to tell mciSendString how to convert the information returned in the MCI structure into string form. (The mciSendString function translates the string interface used by an application to the command interface used by your device driver.) The following flags are defined for the high-order word of the DriverProc return value:
Flag | Meaning |
---|---|
MCI_RESOURCE_RETURNED | Indicates the high-order word of the value in the return member is a string resource ID. This ID is translated by mciSendString by loading the specified resource. |
MCI_RESOURCE_DRIVER | Indicates the high-order word of the value in the return member is a string resource ID defined by the device driver. This flag requires MCI_RESOURCE_RETURNED. |
MCI_COLONIZED3_RETURN | MCI_COLONIZED4_RETURN | Indicates that when the DWORD value in the return member is converted into a string, its individual bytes should be separated by colons. |
MCI_INTEGER_RETURNED | Indicates that the value in a structure that allows either integer or string returns is an integer value. |
Integer return values which have resource string equivalents are indicated by setting the MCI_RESOURCE_RETURNED bit in the error return. This indicates that the high-order word of the value in the return member is a string ID to load. An application that uses mciSendCommand to call your driver will not see the high-order word of the return value when you return MCI_RESOURCE_RETURNED. When this flag is set, MCI will clear the high-order word of the return member before it returns to the application. Using the high-order word for resource data restricts the integer return value to the 16-bits of the low-order word. The following code fragment sets the MCI_RESOURCE_RETURNED bit for the DriverProc return value:
lpStatus-dwReturn = MAKEMCIRESOURCE(MCI_SEQ_FORMAT_SONGPTR,
MCI_SEQ_FORMAT_SONGPTR_S);
return MCI_RESOURCE_RETURNED;
If your device driver defines the resource string, use the MCI_RESOURCE_DRIVER flag with the MCI_RESOURCE_RETURNED flag.
If your device driver returns information in the return member that should be separated by colons when it is displayed, use the MCI_COLONIZED3_RETURN or MCI_COLONIZED4_RETURN flag. For example, 0x01020304 is "colonized" as "4:3:2" for MCI_COLONIZED3_RETURN or "4:3:2:1" for MCI_COLONIZED4_RETURN.
If the return member of the structure can return either integer or string values, and your device driver is returning an integer value, use the MCI_INTEGER_RETURNED flag in the DriverProc return value. For example, the sysinfo command can return both string and integer data. When this flag is set, the returned integer is converted into a string equivalent by mciSendString.
Structures that return string data or RECT data do not require that you set any flags in the return value for DriverProc.