====看不懂例程!!
Private Sub AI_OPEN_Click()
Dim msec As Double
mciWave.UpdateInterval = 0
//为什么要再做一个form来放dlgopenfile?
//FilterIndex是什么意思?
frmOpenDlg.dlgOpenFile.FilterIndex = 1
//flags是什么意思?
frmOpenDlg.dlgOpenFile.Flags = vbOFNReadOnly Or vbOFNFileMustExist
frmOpenDlg.dlgOpenFile.CancelError = True
//这个文件名藏在form里还是dlgopenfile里?
frmOpenDlg.dlgOpenFile.FileName = ""
//resume是什么意思?
On Error Resume Next
frmOpenDlg.dlgOpenFile.ShowOpen
If Err <> 0 Then
Exit Sub
End If
If Not mciWave.Mode = vbMCIModeNotOpen Then
mciWave.Command = "Close"
End If
mciWave.FileName = frmOpenDlg.dlgOpenFile.FileName
//不明白!!!当上面那句错,跳到MCI_ERROR??
On Error GoTo MCI_ERROR
mciWave.Command = "Open"
// 0 在哪里???
On Error GoTo 0
Caption = DialogCaption + mciWave.FileName
//以下均不明白!!!!!!!!!!!!!
mciWave.TimeFormat = vbMCIFormatMilliseconds
lblWave.Caption = "0.0"
msec = (CDbl(mciWave.Length) / 1000)
lblWaveSec.Caption = Format$(msec, "0.00")
' Set the scrollbar values.
hsbWave.value = 0
CurrentValue = 0#
Exit Sub
MCI_ERROR:
DisplayErrorMessageBox
Resume MCI_EXIT
MCI_EXIT:
Unload frmWave
End Sub