Results 1 to 5 of 5

Thread: Ok sorry about this guys, but no search function

  1. #1
    Jethro
    Guest

    Question Ok sorry about this guys, but no search function

    Sorry in advance, would have used search but has been disabled SO here is a question which has been asked a million times previously....our internal archive server is down so cannot log in to extract the code.........................

    Playing wav files.

    Am using

    Code:
    Const SND_SYNC = &H0
    Const SND_NODEFAULT = &H2
    
    Call sndPlaySound(sWavFile, SND_SYNC Or SND_NODEFAULT)
    In a public sub.

    Get the following error

    "Sub or FUnction not defined"

    Do l have to do the declare in the same bas module?

  2. #2
    Addicted Member csammis's Avatar
    Join Date
    Mar 2001
    Location
    /dev/null
    Posts
    226
    That, or wherever you do declare the API call, make it and the constants public. I'd post the code, but the one app I used it in is archived and my archive hard drive is currently failing hideously
    Things I've Said:
    "Life's funny like that...elephants can wear frilly lace panties, and Dubya still looks like a monkey in a big chair"
    "Take four goats and strap one to each foot of a llama. Presto, goat-powered llama!"
    "You want to get me to work more, get me a Coke. No? Then deal with inferior garbage, I'm not coding another line and your clients can go to......thanks, I'd love a Coke right about now!"

  3. #3
    Megatron
    Guest
    Code:
    Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
    
    Private Sub Command1_Click()
        
        PlaySound "MyFile.wav", 0, 1
        
    End Sub

  4. #4
    lord_dude
    Guest
    Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

  5. #5
    Jethro
    Guest
    Was again thanks guys.

    Meg you are a live saver, am hour off giving a demo and the friggin API calls are not working. That's what ya get for coding on the bus on the way to a site l guess

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width