PlaySound

PlaySound

Post by Martin Tud » Sat, 06 Sep 2003 19:28:54


Can anyone with programming skills let me know whats wrong
with this module.
I got a compile
error 'expecting =' on the line that reads

sndPlaySound(pFile, SND_SYNC)

Below is the code I pasted....
Option Compare Database
Option Explicit

Declare Function sndPlaySound Lib "winmm.dll"
Alias "sndPlaySoundA" (ByVal lpszSoundName As String,
ByVal uFlags As Long) As Long
Public Const KEY_RETURN = &HD
Public Const SND_SYNC = &H0
Public Const SND_ASYNC = &H1
Public Const SND_NODEFAULT = &H2
Public Const SND_LOOP = &H8
Public Const SND_NOSTOP = &H10

Public Sub PlaySound(pFile As String)

sndPlaySound(pFile, SND_SYNC)
End Sub

Public Sub PlayIntro()
Dim s As String
s = DBEngine(0)(0).Name
While Right$(s, 1) <> "\": s = Left$(s, Len(s) - 1): Wend
s = s & "setup0.wav"
MsgBox "about to play file " & s
PlaySound s

End Sub
 
 
 

PlaySound

Post by MV » Sun, 07 Sep 2003 09:44:20

Try removing the parentheses.

sndPlaySound pFile, SND_SYNC