vb dll调用约定错误

2024-12-14 08:42:22
推荐回答(2个)
回答1:

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

回答2:

SND_ASYNC是不是没有写常量的数值造成这个的?你最好搜索下这个API的标准接口。