I’m writing a VB6 control around Fmodex to build a player.
It all seems to work just fine except for some stupid quirk:
When i put the control on a form it initializes just fine and it plays ok. However, when i close this form and return to the VB editor i can not restart the project straight away, because FMOD_System_Create() returns FMOD_OK, but my sysem variable remains zero.
Funny thing is that this does NOT happen when i feed it a filename by code directly. When i do that, i can stop and restart the project without any problem. It only happens when i use the Open File dialog (using the commdlg32.ocx or straight from API calls makes no difference)
I have checked, but when closing the form the Usercontrol_Terminate() event is fired correctly and there i use the following code to shutdown FMOD:
If Channel Then
lResult = FMOD_Channel_Stop(Channel)
Channel = 0 ‘destroy the handle
If Sound Then
lResult = FMOD_Sound_Release(Sound)
Sound = 0 ‘destroy the handle
If System Then
lResult = FMOD_System_Release(System)
System = 0
Whenever the form shows again, the UserControl_Initialize() event gets fired as it should and that’s where i put my FMOD_System_Create() command.
Can anyone tell me what i am doing wrong here?
- Theo asked 13 years ago
- You must login to post comments