|
-
Oct 26th, 2001, 10:51 AM
#1
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
-
Oct 27th, 2001, 05:14 AM
#2
Registered User
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]
-
Oct 27th, 2001, 06:49 AM
#3
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.
-
Oct 27th, 2001, 05:28 PM
#4
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|