'改成这样:
Option Explicit
Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long
Private Declare Function sndPlaySoundFromMemory Lib "winmm.dll" Alias "sndPlaySoundA" (lpszSoundName As Any, ByVal uFlags As Long) As Long
Private Const SND_ASYNC = &H1&
Private Const SND_MEMORY = &H4&
Private Sub Command1_Click()
Dim bArr() As Byte
bArr = LoadResData(101, "wave")
sndPlaySoundFromMemory bArr(0), SND_ASYNC Or SND_MEMORY
End Sub
不能把Function放在Sub事件里,放在(通用)里