正确的程序定义和使用如下： 
    Private Const MCI_DEVTYPE_CD_AUDIO = 516 
    Private Type MCI_OPEN_PARMS 
     dwCallback As Long 
     wDeviceID As Long 
     lpstrDeviceType As Long 
     lpstrElementName As String 
     lpstrAlias As String 
    End Type 
     
    Private Declare Function mciSendCommand Lib "winmm.dll" Alias "mciSendCommandA" _ 
     (ByVal wDeviceID As Long, ByVal uMessage As Long, ByVal dwParam1 As _ 
     Long, dwParam2 As Long) As Long 
    Private Declare Function mciGetErrorString Lib "winmm.dll" Alias "mciGetErrorStringA" _ 
     (ByVal dwError As Long, ByVal lpstrBuffer As String, ByVal uLength As Long) As Long 
     
    MCIO.lpstrDeviceType = MCI_DEVTYPE_CD_AUDIO 
    MciError = mciSendCommand(iDev, MCI_OPEN, MCI_OPEN_TYPE Or MCI_OPEN_TYPE_ID, MCIO.dwCallback) 
    If MciError = 0 Then 
     mciSendCommand MCIO.wDeviceID, MCI_CLOSE, MCI_WAIT, 0 
    Else 
     ErrStr = Space(255) 
     mciGetErrorString MciError, ErrStr, 255 
     MsgBox ErrStr 
    End If 
<END>