Hi Marc, glad you got your answer. Q: would you be willing to share some
simple examples for invoking MIDI API calls in C# (playing individual or
groups of notes against a specific device would be cool)? I posted a
question about this several days ago, and the only response I got was
someone else also wanting to know!
Thanks,
Richard
Quote:
> I have some problems with the midiOutGetErrorText API using Csharp (VS.NET
> beta 2):
> [DllImport( "winmm.dll")]
> private static extern int midiOutGetErrorText(int err, ref string
lpText,int
> uSize);
> Everytime I call the function (using something like below) I get the "We
are
> sorry for the inconveniance" error screen in XP.
> int result;
> int OutErr = 8; // Just as an exemple to retrieve error #8
> int MAXERRORLENGTH = 128; //Lenght of the return string
> string strMsg = new String('*',MAXERRORLENGTH); // The function is
supposed
> to return the error text in this string
> //Now I call the function and I get the error screen
> result = midiOutGetErrorText(OutErr, ref strMsg, MAXERRORLENGTH);
> I also tried without the "ref" keyword and it doesn't work as it returns
the
> exact same string (but I don't get the error).
> I have no problem at all with other MIDI functions like midiOutOpen,
> midiGetDevCaps and so on... They all work great except the
> midiOutGetErrorText.
> Any help will be appreciated
> Marc