'API Class to take care of playing the file
Public Declare Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long作者: 自我感覺良好 時間: 2017-12-11 07:20
回復 1#自我感覺良好
'API Class to take care of playing the file
Public Declare Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
' 修改成如下便可以了 ( PtrSafe )
' API Class to take care of playing the file
Public Declare PtrSafe Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long作者: c_c_lai 時間: 2017-12-12 15:03
回復 3#自我感覺良好
如果同時要在 32 / 64 位元下均能執行,請修改成:
#If VBA7 Then
'API Class to take care of playing the file
Public Declare PtrSafe Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
#Else
Public Declare Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
#End If作者: 自我感覺良好 時間: 2017-12-12 18:11