Help with midiOutOpen()

jasonjason United Kingdom
Hi all.

Can anyone spot a problem with the following snippet of code. I'm just trying to open the midi out device in order to send a few short messsages.

HMIDISTRM stream = NULL;
LPHMIDIOUT lphmo = NULL;
MIDIOUTCAPS caps;

unsigned int dev = midiOutGetNumDevs() - 1;

int result = midiOutGetDevCaps( dev, &caps, sizeof( MIDIOUTCAPS ) );
int result0 = midiOutOpen( lphmo, dev, 0, 0, CALLBACK_NULL );

The midiOutOpen() function is returning with

MMSYSERR_INVALPARAM The specified pointer or structure is invalid.

Would this error occur if the device is already open by another application or the OS (Win XP)?

Any help much appreciated. Jason

Comments

  • I'm having exactly the same problem in Win XP (using VB .NET), but haven't found a solution yet.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion