0
0

Hi All,

I am desperately trying to get fmodce working on Windows Mobile 2003 using C# and the .NET Compact Framework.

Has anybody got this working before? I’ve read heaps and heaps about writing wrappers, and dealing with unmanged code etc.. but I still can’t get this thing working!

I just don’t get it, i’ve written a small program that works fine under Windows XP using C# and the .NET Framework, but the same code (or very similar) wont work on Windows Mobile 2003 when compiled against the .NET Compact Framework. All I get is a Native Exception (see http://52.88.2.202/forum/viewtopic.php?t=3115), after the FSOUND_StreamPlay(-1, a); call.

This code works perfectly on Windows XP using C# and the .NET Framework
[code:16xvhdts]
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Runtime.InteropServices;

namespace SoundTest
{
public class SoundTestForm : System.Windows.Forms.Form
{
[DllImport( "fmod.dll", EntryPoint="FSOUND_Init" )]
public static extern bool FSOUND_Init( int mixrate, int maxsoftwarechannels, uint flags );

    [DllImport( "fmod.dll", EntryPoint="FSOUND_Stream_Open" )] 
    public static extern IntPtr FSOUND_StreamOpen( string name_or_data, int mode, int offset, int length ); 

    [DllImport( "fmod.dll", EntryPoint="FSOUND_Stream_Play" )] 
    public static extern int FSOUND_StreamPlay( int channel, IntPtr stream ); 

    public SoundTestForm()
    {
        IntPtr a = new IntPtr(0);
        bool inited = FSOUND_Init(44100, 32, 0);
        a = FSOUND_StreamOpen(@"c:\music.mp3", 0, 0, 0);
        FSOUND_StreamPlay(-1, a);
    }

    protected override void Dispose( bool disposing )
    {
        base.Dispose( disposing );
    }

    static void Main() 
    {
        Application.Run(new SoundTestForm());
    }
}

}
[/code:16xvhdts]

This code does NOT work under Windows Mobile 2003, using C# and the .NET CF.
[code:16xvhdts]
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Runtime.InteropServices;

namespace SoundTest
{
public class SoundTestForm : System.Windows.Forms.Form
{
[DllImport( "fmodce.dll", EntryPoint="FSOUND_Init" )]
public static extern bool FSOUND_Init( int mixrate, int maxsoftwarechannels, uint flags );

    [DllImport( "fmodce.dll", EntryPoint="FSOUND_Stream_Open" )] 
    public static extern IntPtr FSOUND_StreamOpen( string name_or_data, int mode, int offset, int length ); 

    [DllImport( "fmodce.dll", EntryPoint="FSOUND_Stream_Play" )] 
    public static extern int FSOUND_StreamPlay( int channel, IntPtr stream );

    public unsafe SoundTestForm()
    {
        IntPtr a = new IntPtr(0);
        bool inited = FSOUND_Init(44100, 32, 0);
        a = FSOUND_StreamOpen(@"\\music.mp3", 0, 0, 0);
        FSOUND_StreamPlay(-1, a);
    }

    protected override void Dispose( bool disposing )
    {
        base.Dispose( disposing );
    }

    static void Main() 
    {
        Application.Run(new SoundTestForm());
    }
}

}
[/code:16xvhdts]

Does anybody have any idea’s as to what’s going on?

Has anybody got this working before, and if so, can pleeeese post your code?

Also, what fmodce.dll should I be using for a) the Windows Mobile 2003 emulator, and b) an iPAQ H2210 running WM2003?

If anyone has a working wrapper, could they sent it to me at stephen dot larkin at gmail dot com

Any help is greatly appreciated!

Cheers,
Steve

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.