求助:使用mciSendStringA无法进行循环播放MID文件
源码如下:Private Declare Function mciSendStringA Lib "winmm.dll" (ByVal lpstrCommand As String, _ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Dim yn_play As Boolean
Private Sub Command1_Click() '音乐测试
Dim k As String
k = "D:\music.mid"
k = "OPEN " + k + " TYPE SEQUENCER ALIAS mid1" '
mciSendString k, 0&, 0, 0
If yn_play = False Then
mciSendString "PLAY mid1 FROM 0", 0&, 0, 0 '开始播放
mciSendString "play mid1 repeat", 0&, 0, 0'按有关说明,此语句控制循环播放,经实测却无效
'mciSendString "CLOSE ANIMATION", 0&, 0, 0
yn_play = True
Command1.Caption = "停止播放"
Else
mciSendString "STOP mid1", 0&, 0, 0 '停止播放
mciSendString "CLOSE ANIMATION", 0&, 0, 0
yn_play = False
Command1.Caption = "音乐测试"
End If
End Sub