Hello, I’m at an intermediate lvl of vb, and completely new to FMOD.DLL. I’ve been messing around with it and am utterly plagued by memory errors that wind up crashing my IDE. If I comment out the lines that initialize the .dll and avoid any functions that attempt to play any streams the program may give a debugger error that I need to correct, but it will not give an exception error and close the IDE.
With the lines uncommented, the .dll initializes fine, and I can play the mp3/stop the mp3 fine. However if an error occurs it gives an exception error tossing out some memory addresses and closes the vb.
I want to be clear by saying that when I’m talking about an ‘error’ occuring it’s my own code, one example is I forgot the set an object before accessing it, which of course is a newb mistake and causes an error. But it shouldn’t crash the IDE, and doesn’t if I were to do it w/fmod.dll initialization commented out.
I appreciate any help,
- Anonymous asked 15 years ago
Hrmmm.. that makes sense, which is certainly progress.
My next question is there something I can do to prevent that? It will certainly make coding a program tedious if I’m not able to stop it etc.
I notice the From_Terminate event… if I toss FMOD_Close in there will it help? Or do you have any suggestions for me?
Thanks for your time,
Err.. FSOUND_Close is what I meant.. I do have that in the Unload event already, and the online help said the Terminate event gets triggered after the Unload event so I’m guessing that won’t help. :/
Am I left with needing to type FSOUND_Close in the Immediate window if I know I’m going to have to stop the program? If I keep it in debug mode it doesn’t appear to crash the IDE.
Welp, having FSOUND_Close in my Unload event doesn’t help when pressing the Stop button.. however, if I know I need to press the Stop button I’ve been issuing FSOUND_Close from the Immediate window beforehand and that seems to have fixed the problem.
It’s a little bit of a pain, but it’s oodles better then having it crash every time.
I greatly appreciate your help! I would have never thought to try that if you didn’t mention it.
[quote="Sterg":3pq2in0c]Welp, having FSOUND_Close in my Unload event doesn’t help when pressing the Stop button..[/quote:3pq2in0c]
Yes, that is because pressing the stop button will not process the Unload event, you have to actually press the X button on your window.
In my program I have a hotkey (CTRL-ALT-A) that will call the close function. I’m not sure if you can close FMOD from another thread but if you can then how about making another program that simply calls that close function? When it errors out, you run that program and then press stop, and you’re still in VB
Isn’t it easiest to just close your app as you would do when you were not running it in vb?
(so just the exit button, the close button of your form, … instead of vb’s stop button)
If your program was written well it should close FSOUND at that point and you shouldn’t have any problems.
In most cases you don’t need a restart for code changes.
Just move the execution point to some lines above or below the line you want to change, and then change it.
That way vb won’t complain about it, and you can just continue your app.
I also usually put all my destroy code in one public function (like ‘ExitApp’) which I can easily call from the immediate pane if necessary.
Well I have a little more information on the problem, although it doesn’t clear things up for me, nor does it help resolve anything. But here goes…
Even if my program is running without error, if I CTRL-BREAK and then press the STOP button in the IDE I get a memory exception.
I downloaded the example that is provided in the first sticky post of this forum, it ran like a champ. However, if I intentionally remove a letter from a variable and attempt to run the program, it’ll error out as expected.. but it will also cause the exception error and crash/close the IDE just as it does with my own program.
Am I the only person that this is happening to??
I’m running Win2k SP2, VB 6 SP5. I’ve had no such problems with any other VB projects I’ve messed around with.
Thanks in advance for any input,
Hiya Sterg, one thing i would like to point out is that you are still messing mostly with simple VB stuff, you will have to get used to calling unload functions from the dump windows. You will soon quickly learn that VB itself can’t cut it, and that you will need to start making lots of api calls, using api timers, ect to get your app to preform the way you want it to, for without them VB is…slow.
Aidon hit the nail on the head, the simplest way is to put critical dump code into one function that you can call from the immediate pane. Only other suggestion i can offer is to save often, but then you probably already figured that one out!
If you do not call FMOD_Close before you close the program than it will give you an error because the program will close but FMOD will stay open. Thus, an error would have happened. This is why just pressing stop in the VB IDE will crash VB and giove you an error, becuase the stop button will not call FMOD_Close, it will just end the program as-is.
Please login first to submit.