At least one, first parameter is wrong. It's a pointer to a handle, so you need an
out
parameter passing for this one instead:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd798476%28v=vs.85%29.aspx[
^].
This should work:
http://www.pinvoke.net/search.aspx?search=midiOutOpen&namespace=[All][
^].
For VB.NET,
out
parameters passing method is not supported (shame on it), so
ByRef
is used instead. (The difference is purely syntactic:
ref
parameter should be initialized before passing,
out
does not require that, but the called code is supposed to initialize it, which is also required — in C#.)
—SA