Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Sub bofang()
Const SND_ASYNC = &H1
Dim SoundFile As String, Result As Long
SoundFile = App.Path & "\报警声音\" & "baojing.wav"
If Dir(SoundFile) <> "" Then Result = sndPlaySound(SoundFile, SND_ASYNC)
end Sub
Private Sub Form_Load()
bofang
End Sub
SND_ASYNC是不是没有写常量的数值造成这个的?你最好搜索下这个API的标准接口。