Sound Resource File & XP crash
This sound resoucre fil works great in Win98
but in Xp it take about 3 seconds to load and osmtimes doesnt play and also crashes VB or the program
Is there an update to get please help???
Code:
Option Explicit
Private Declare Function sndPlaySound Lib "winmm.dll" _
Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
Private Const SND_ASYNC = &H1 ' play asynchronously
Private Const SND_MEMORY = &H4 ' lpszSoundName points to a memory file
Private Const SND_NODEFAULT = &H2 ' silence not default, if sound not found
Private Sub PlayIt(WavID As Variant)
Dim SoundBuffer As String
SoundBuffer = StrConv(LoadResData(WavID, "WAVE"), vbUnicode)
sndPlaySound SoundBuffer, SND_ASYNC Or SND_NODEFAULT Or SND_MEMORY
End Sub
Private Sub Command1_Click()
PlayIt "CHIMES"
End Sub
Private Sub Command2_Click()
PlayIt "CHORD"
End Sub
Private Sub Command3_Click()
PlayIt "DING"
End Sub