0
0

Hi,
I am trying to set a callback for when fmod reaches the end of the track.

this is the code I am using:

[code:207aovyc][DllImport("fmodce.dll", EntryPoint = "FSOUND_Stream_SetEndCallback")]
public static extern bool FSOUND_Stream_SetEndCallback(IntPtr stream, FSOUND_STREAMCALLBACK callBack, int userData);

public delegate void FSOUND_STREAMCALLBACK(IntPtr stream, IntPtr buff, int len, int param);[/code:207aovyc]

however when i run the implementation of this code:
[code:207aovyc]
FMOD.FSOUND_STREAMCALLBACK finish = new Smart.Common.Playback.FMOD.FSOUND_STREAMCALLBACK(Finished);
FMOD.FSOUND_Stream_SetEndCallback(_openFile, finish, 0);[/code:207aovyc]

It gives me a not supported exception. Have i declared the set end callback method incorrectly?

Thanks for your help

  • You must to post comments
0
0

Thanks to Neil Cowburn I have the answer and solution to this problem.
The answer is that you cannot marshall delegates using pinvoke on version 1 of the cf.

The solution is here [url:3cbelvfx]http://blog.opennetcf.org/ncowburn/PermaLink,guid,6d16f1d6-47bd-493f-8d27-6a42b24a234e.aspx[/url:3cbelvfx]

  • You must to post comments
0
0

Hello,
I have the same problem, I read Neil comment, but there are some errors in his code and I cannot resolve it. For example in “fmodcf.h” we have the declaration:
FMODCF_API int SetStreamEndCallback(FSOUND_STREAM* pfsStream, HWND WndProc);
and in “fmodcf.cpp” there is the implementation
FMODCF_API int SetStreamEndCallback(HINSTANCE* hFmodLib, FSOUND_STREAM* pfsStream, HWND WndProc){…}.

Here there is a new parameter HINSTANCE* hFmodLib, what should I do with this?

If you can send me your code for fmodcfShim, it would be great.

Thanks alot.

  • You must to post comments
0
0

I actually have’t had time to implement this yet!
You know what it is like, other priorities and all…

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.