简体   繁体   中英

Why midiOutOpen returns 1 (=Unspecified error) in a UWP app?

As soon as I convert the app, the midiOutOpen function starts to return 1 on being called.

I declare it as:

VB
Shared Function midiOutOpen(ByRef lphMidiOut As IntPtr, uDevID As IntPtr, cBack As IntPtr, dwinst As IntPtr, dwFlags As UInt32) As UInt32

Is there a way to use winmm.dll/midiOutOpen from a packaged app( .appx ) that can still be published to MS store? Or some other way to acquire the handle of the midi device (ID 0)?

It looks like the midiOutOpen function and other APIs like midiOutShortMsg function do not work in desktop bridge apps.

Currently, we'd suggest you use the modern MIDI from Windows.Devices.Midi Namespace . You could refer to the sample here: MIDI sample .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM