## MMPM/2 Device Driver Reference

[prev][next][parent][TOC]

### Initializing IDC Communication

To initialize communication between your driver and RTMIDI:

Use the following code segment to obtain the main IDC entry point to RTMIDI and the entry points used to register the driver with RTMIDI. DevHelp_ AttachDD is used to obtain the main entry point, and DDTable.pfn retrieves the registration entry points.

This routine is normally executed when processing the init_complete strategy call. Make sure that DDTable is located in the current data segment (DS) and not on the stack (SS).

    MIDI_ATTACH_DD  DDTable;

    MIDI_REGISTER  reg;

    if (DevHelp_AttachDD("MIDI$ ", (NPBYTE) &DDTable ) )

    {

      // Error

      // Return

    }

    reg.usSize=sizeof( MIDI_REGISTER );

    DDTable.pfn(&reg);