0
0

Since using fmod/fmodex, I encountered random Division by Zero problems, so no division was performed. Took some while, I got a simple workaround:

Public Sub GrabError()
Dim xLong1 as Long
On Error Resume Next
xLong1 = Timer
On Error GoTo 0
End Sub

(Using the timer function always responds to this error)
Just inserted after some fmod/fmodex calls, and all worked fine.

Recently I rewrote my fmod/fmodex layer stuff in PureBasic as external dll, so I can update/replace this dll without having to recompile my player. The problem now is I don’t know if/how to cause this error in purebasic, so it still occurs in visual basic (So it seems those errors got fewer?). And as it’s fmod/fmodex related, I don’t want to add a ‘GrabError’ call after each fmod/fmodex usage (through my dll).
(This PureBasic-dlls are based on the VB6 api declaration, using many CallFunction/…)

I’ve tried SetLastError(0), but still same problem.

Seems to be Win9x problem, at least I tried on Win98(se) and Win2000, and I didn’t have that problem (yet).
To reproduce (on Win98), use the playsound vb-example:
rename Timer control to Timer1, rename
Private Sub Timer_Timer()
to
Private Sub Timer1_Timer()
and use the timer function within Timer1_Timer(), e.g.


result = FMOD_System_GetChannelsPlaying(System, channelsplaying)
ERRCHECK (result)
Debug.Print Timer

This should cause the error. You can click debug, then simple resume to avoid the crash :)

Does anyone know how to get a workaround for this problem, either using API or maybe reproducing/handling a similar error on PureBasic?

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.