Results 1 to 4 of 4

Thread: Make winmm.dll stop!!!

  1. #1
    ljameslo
    Guest

    Unhappy Make winmm.dll stop!!!

    Hopefully someone outthere can stop this madness.

    we are using the playsound function in winmm.dll to play an alarm sound in a loop. When when the application eixt not properly, the instance of winmm.dll will stay in memory and keep playing the alarm in loop. I am just hoping there is a way to stop it outside of the origin application. I know I have create a memory leak when this is happening, is there a way to kill the instance of dll running?

    thanks

    - L. James Lo, MCSD

  2. #2
    Registered User
    Join Date
    May 2001
    Location
    taizhou zheziang china
    Posts
    17

    Have u set the instance to nothing

    Example:

    dim claTest as ClassName
    set claTest=nothing

    or have you close the device?

    dim lAPIReturn as long
    lAPIReturn =mciExecute("close DeviceName")

    and a question,are u a MCSD?
    can u tell me some advices how I can pass MCSD?

    Waiting for your teaching!
    [email protected]

  3. #3
    jim mcnamara
    Guest
    Instead of linking it into the project, call LoadLibrary()
    then FreeLibrary() in the Form_QueryUnload().

    That way if the program exits, FreeLibrary() will remove the
    PlaySound api (or whatever) from memory.

    Unless the winmm.dll is in an ActiveX control. Then you are stuck.

  4. #4
    Hyperactive Member Eyes.Only's Avatar
    Join Date
    Oct 2001
    Location
    Minnesota
    Posts
    347

    Post

    I was using sndPlaySound Lib "winmm.dll" to play wavs from a data stream i held in memory (didnt want to create a temp file). The way i stopped it was used the Forms Terminate event and ran the stop command in there for those times when it would close abnormally.

    But Ive found that playing many wavs consecutively with this API tends to suck up the memory, so i need to free it or unload it after each wav it plays. So Im quite curious how i can use the LoadLibrary() and FreeLibrary(). I guess ive never seen it used before.

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