Winapi: midioutopen-enable the Midi output device

Source: Internet
Author: User
Because the callback function is accessed during the interruption time, it must be in the DLL; the data to be accessed must be in a fixed data segment;
Outputdebugstring cannot be called by other systems.
 // Declaration: midioutopen (lphmidiout: phmidiout; {the pointer used to return the device handle; this handle should be used to call other functions later} udeviceid: uint; {Device ID; you can specify midi_mapper = uint (-1);} dwcallback: DWORD {callback function address or window handle. If the callback mechanism is not used, set it to nil} dwinstance: DWORD {instance data for the callback function; not used in the window} dwflags: DWORD {open option}): mmresult; {0 is returned for success; possible error values can be found below :} mmsyserr_baddeviceid = 2; {Device ID} mmsyserr_allocated = 4; {the specified resource has been allocated} mmsyserr_nomem = 7; {memory cannot be allocated or locked} midierr_nomap = 66; {No MIDI ing is currently available. Only the  Program  of the ing is enabled.} midierr_nodevice = 68; {the port in the Midi ing does not exist, it is only possible to open the ing program} // optional value of the open option dwflags: callback_null = $00000000; {specified when dwcallback is nil} callback_window = $00010000; {When dwcallback is a window handle, specify} callback_function = $00030000; {When dwcallback is a function pointer} // if you select a window to receive callback information, messages that may be sent to the window include: mm_mom_open = $3c7; mm_mom_close = $3c8; mm_mom_done = $3c9; // if you select a function to receive callback information, the messages that may be sent to the function include: mom_open = mm_mom_open; mom_close = mm_mom_close; mom_done = mm_mom_done;

   // example:


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.