winmm.dll entry points ?

G

Guillaume

Here after was my code available in a vb module referenced
to play a sound on a specific action. Using my programm
with Windows 2000 generates an error message : "Can't find
DLL entry point SndPlaySound in winmm.dll"
Any thought ?

Private Declare Function sndPlaySound Lib "winmm.dll" _
() 'Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_NODEFAULT = &H2
Const SND_LOOP = &H8
Const SND_NOSTOP = &H10

Public Sub PlayLowSound()
Dim SoundFile As String
Dim wFlags As Long, x As Long
SoundFile = FlexSheet2.TxtLowerSound.Text
wFlags = SND_ASYNC Or SND_NODEFAULT
x = sndPlaySound(SoundFile, wFlags)

End Sub

Public Sub PlayHighSound()
Dim SoundFile As String
Dim wFlags As Long, x As Long
SoundFile = FlexSheet2.TxtUpperSound.Text
wFlags = SND_ASYNC Or SND_NODEFAULT
x = sndPlaySound(SoundFile, wFlags)

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Assign a sound to a variable 19
Sound repeats unending until closing workbook 2
Wavfile playing trubcated 3
PlaySound 1
Calling A Module 5
Calling a Module 1
playing wma files 2
applcation.run 4

Top