• 回复
  • 收藏
  • 点赞
  • 分享
  • 发新帖

建立VB6资源文件播放wav文件,出现“编译错误”,错在哪里?

 先用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
全部回复(1)
正序查看
倒序查看
jyq001
LV.3
2
2010-03-13 14:51

截图如下:

  

0
回复