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;
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