I am trying to write a wrapper library for MIDI functions in WinMM.dll, but I am having problems with long MIDI messages. I found this in PIvnoke.net (I added the first line):
[StructLayout(LayoutKind.Sequential)] public struct MIDIHDR { IntPtr lpData; int dwBufferLength; int dwBytesRecorded; IntPtr dwUser; int dwFlags; MIDIHDR lpNext; IntPtr reserved; int dwOffset; IntPtr dwReserved; }
But when compiling, I get an error:
Error 1 Struct element 'WinMMM.MidiWrapper.MIDIHDR.lpNext' of type 'WinMMM.MidiWrapper.MIDIHDR' causes a loop in the structure structure C: \ Users \ Alex \ Documents \ Visual Studio 2010 \ Projects \ WinMMM \ WinMMM \ MidiWrapper.cs 219 219 Winmmm
I am using Visual Studio Ultimate 2010, I am creating a C # class library and any help would be appreciated!
Mika source share