Windows Multimedia DDK (mddkqh.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
MODM_OPEN
                                                 Contents Index Back
────────────────────────────────────────────────────────────────────────────
MODM_OPEN
 
        This message is sent to a MIDI output driver to allocate a
        specified device for use by a client application.
 
Parameters
        DWORD dwParam1
            Specifies a far pointer to a MIDIOPENDESC structure. This
            structure contains additional information for the driver
            such as instance data from the client and a callback for
            the client.
 
        DWORD dwParam2
            Specifies option flags for opening the device.
 
            CALLBACK_WINDOW
                If this flag is specified, dwCallback in the
                MIDIOPENDESC structure is assumed to be a window handle.
 
            CALLBACK_FUNCTION
                If this flag is specified, dwCallback in the
                MIDIOPENDESC structure is assumed to be the address of
                a callback function.
 
            CALLBACK_TASK
                If this flag is specified, dwCallback in the
                MIDIOPENDESC structure is assumed to be a handle to a
                task.
 
Return value
        The return value is an error code, or zero (MMSYSERR_NOERROR) if
        the operation is successful. Possible error codes are:
 
        MMSYSERR_NOTENABLED
            The driver failed to load or initialize.
 
        MMSYSERR_ALLOCATED
            The device is already allocated by the maximum number of
            clients the driver supports or the device cannot be opened
            because of system resource limitations other than memory.
 
        MMSYSERR_NOMEM
            The device cannot be opened because of a failure allocating
            or locking memory.
 
Comments
        It is up to the driver to determine the number of clients
        allowed to use a particular device. Once a device is opened for
        the maximum number of clients the driver supports, the driver
        should return MMSYSERR_ALLOCATED for any additional open
        requests. If the open operation is successful, the driver should
        use the DriverCallback function to send the client a MOM_OPEN
        message.
 
See also
        MODM_CLOSE, MIDIOPENDESC
 
                                       -♦-