Hej Lars,
>I guess my main problem is that I still don't really understand
>interop...:-)
There are a couple of good books and articles available if you want to
learn more about it.
>Structures:
>MIDIHDR
struct MIDIHDR
{
public IntPtr lpData;
public uint dwBufferLength,
dwBytesRecorded;
public IntPtr dwUser;
public uint dwFlags;
private IntPtr lpNext,
reserved;
public uint dwOffset;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=4)]
private IntPtr[] dwReserved;
}
>Callbacks:
>MidiInProc
delegate void MidiInProc(IntPtr hMidiIn, uint wMsg, IntPtr dwInstance,
uint dwParam1, uint dwParam2);
>Functions:
>midiInOpen (the callback part)
[DllImport("winmm.dll")]
static extern uint midiInOpen(out IntPtr lphMidiIn, IntPtr uDeviceID,
MidiInProc dwCallback, IntPtr dwCallbackInstance, uint dwFlags);
If you still have problems with the other function, feel free to
follow up.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Lars Lundstedt - 08 Sep 2003 21:08 GMT
Tack Mattias!
> Hej Lars,
>
[quoted text clipped - 43 lines]
> http://www.msjogren.net/dotnet/
> Please reply only to the newsgroup.