Tests if MidiShare is resident in memory by looking for a specific pattern of code. This is the first MidiShare function that an application should call.
pascal Boolean MidiShare(void);
none.
The result is true when MidiShare is loaded, false otherwise.
A do-nothing MidiShare application.
#include <MidiShare.h> #include <stdio.h> short myRefNum; main() { if ( ! MidiShare() ) exit(1); /* Check MidiShare loaded */ myRefNum = MidiOpen("Sample"); /* Ask for a reference number */ if ( myRefNum < 1 ) exit(1); /* Check MidiOpen success */ printf( "refNum : %i \n", myRefNum);/* Print the reference number*/ MidiClose(myRefNum); /* And close */ }
MidiShare was originally developed for Pascal on the Macintosh. Consequently, in C, all strings passed as arguments of a MidiShare function must be Pascal strings. In the previous example, one must write :
myRefNum = MidiOpen("\pSample");