0
0

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,

Sterg

  • You must to post comments
0
0

[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.

  • You must to post comments
0
0

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 :)

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

Have you taken a look at the example included with the zip??? Although it doesn’t show how to use the new features of 3.6, it will still show you how to basically use fmod.

  • You must to post comments
0
0

Yes, but if there are errors with other parts of your code, you must pause it, and if it requires a restart…. Well then FMOD bombs!

  • You must to post comments
0
0

Yes I have checked the example.. as a matter of fact I’m pretty much just copying and pasting code from that example in an attempt to figure things out.

Sterg

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

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,
Sterg 😕

  • You must to post comments
0
0

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! :)

++Cire.

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

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,
Sterg

  • You must to post comments
0
0

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.

Sterg

  • You must to post comments
0
0

It shouldn’t crash if FMOD_Close is called before closing the program. So, I dont know any other solution.

  • You must to post comments
0
0

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.

Take care,
Sterg

  • You must to post comments
Showing 14 results
Your Answer

Please first to submit.