vb6有关声音的问题
OptionExplicitPrivateDeclareFunctionmciSendStringLib"winmm.dll"Alias"mciSendStringA"(...
Option Explicit
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
'添加一个按钮
Private Sub Command1_Click()
mciSendString "close c:\windows\media\ding.wav", vbNullString, 0, 0
mciSendString "open c:\windows\media\ding.wav", vbNullString, 0, 0
mciSendString "play c:\windows\media\ding.wav", vbNullString, 0, 0
End Sub
为什么用了这种方法后一运行就提示“变量未定义”(Form_Load里用了For循环)?如何修改? 展开
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
'添加一个按钮
Private Sub Command1_Click()
mciSendString "close c:\windows\media\ding.wav", vbNullString, 0, 0
mciSendString "open c:\windows\media\ding.wav", vbNullString, 0, 0
mciSendString "play c:\windows\media\ding.wav", vbNullString, 0, 0
End Sub
为什么用了这种方法后一运行就提示“变量未定义”(Form_Load里用了For循环)?如何修改? 展开
2个回答
展开全部
Option Explicit 表示所有变量都要进行定义,不定义就会出错
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询