先用VB6资源编辑器建立了一个包含WAV文件的资源文件,然后再窗体的按钮的click事件上写入以下代码,按F5出现运行出现“编译错误:在end sub,end End function或end属性后面只能出现注释!”。请讲解为盼。按钮click事件代码如下:
Private Sub Command1_Click()
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
End Sub