[ Home | Alpha index | Topic index | Tutorials | Download | Feedback ]

The OS/2 API Project


[ Syntax | Params | Returns | Include | Usage | Structs | Gotchas | Code | Also ]


rc = MIDIAddLink( minstanceSource, minstanceTarget, ulSlotNumber, ulFlag );


MINSTANCE minstanceSource (input)
The source instance number.

MINSTANCE minstanceTarget (input)
The target instance number.

ULONG ulSlotNumber (input)
The slot number of the source instance.

ULONG ulFlag (input)
This parameter is not currently used and must be set to 0.


The following values can be returned
0NO_ERROROperation was successful.
7003MIDIERR_INTERNAL_SYSTEMError, The RTMIDI subsystem has become corrupt, and the application should terminate immediately, cleaning up as much as possible. Rebooting will most likely be necessary to restore RTMIDI to a functional state.
7007MIDIERR_INVALID_FLAGError, The ulFlag value is not set to 0.
7009MIDIERR_INVALID_INSTANCE_NUMBERError, Either the source or target instance number is invalid.
7010MIDIERR_INVALID_PARAMETERError, The ulSlotNumber parameter contains an invalid value.
7014MIDIERR_NOT_ALLOWEDError, An attempt was made to create a link either between two instances not owned by this process or between a hardware node and an instance owned by another process.
7016MIDIERR_RESOURCE_NOT_AVAILABLEError, There are not enough resources to create any new links.

Include Info

#include <mididll.h>

Usage Explanation

MIDIAddLink creates a link from the source instance (minstanceSource) to the target instance (minstanceTarget) on the specified slot (ulSlotNumber).

Relevant Structures


A link is only allowed between two hardware nodes, a hardware node and an instance owned by this process, or between two instances which are owned by this process.

The value of the slot number (ulSlotNumber) depends on the class of the source instance. The class defines the number and meaning of the slots of its instances. Most classes only provide one slot, so ulSlotNumber will be 0 for these classes.

Sample Code

#include <mididll.h> MINSTANCE miSource; MINSTANCE miTarget; ULONG ulSlot; /* Create a link from the instance identified with miSource */ /* to the instance identified with miTarget, on the slot */ /* of the source instance rc = MIDIAddLink(miSource, miTarget, ulSlot, 0); if (rc != 0) { /* We got an error to take care of. */ }

See Also

MIDIRemoveLink.html, MIDIQueryInstanceInfo,


Timur Tabi - http://www.shirenet.com/~crusader/Timur/


Last Modified November 9/1996
Please send all errors, comments, and suggestions to: timur@vnet.ibm.com

The OS/2 API Project