使用Microsoft GS Wavetable Synth的Windows 10上的midiOutOpen失败 [英] midiOutOpen on Windows 10 using Microsoft GS Wavetable Synth fails

查看:1574
本文介绍了使用Microsoft GS Wavetable Synth的Windows 10上的midiOutOpen失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个依赖于内置Microsoft GS Wavetable Synth的应用程序.它已在Windows XP,Vista,7、8和8.1上完美运行.在Windows 10上首次调用midiOutOpen时,后续调用将导致错误代码1,表示未指定错误".代码很简单:

I have an application that relies on the in built Microsoft GS Wavetable Synth. It has worked flawlessly on Windows XP, Vista, 7, 8 and 8.1. While the first call to midiOutOpen on Windows 10 works, subsequent calls result in error code 1, meaning 'Unspecified error'. The code is simple:

result = midiOutOpen(&_midiOutHandle, midiOutputDevice, NULL, 0, CALLBACK_NULL);

关于如何解决此问题的任何想法,深表感谢.

Any ideas regarding how to resolve this hugely appreciated.

推荐答案

我看到了.追溯机器代码,我看到了 modMessage() 函数失败并返回MMSYSERR_ERROR.究竟是为什么我不清楚,它看起来像是缺少的初始化问题.

I see it. Tracing through the machine code, I see the modMessage() function fail and return MMSYSERR_ERROR. Exactly why isn't clear to me, it looks like a missing initialization problem.

此事故的奇怪之处在于,对此的投诉并不多,您可能还会想到很多其他程序.或为此在Win10出厂之前对其进行测试.我尝试的下一件事是添加在测试程序中跳过的任何非平凡音频应用程序中发生的一件事.部分地是由于在modMessage的符号中看到"ATL",尽管它并非遥不可及.我将此添加为main()的第一行:

What is strange about this mishap is that there are not a lot of complaints about it, you'd expect plenty of other programs fall over as well. Or for that matter for them to be tested before Win10 shipped. Next thing I tried is adding the one thing that happens in any non-trivial audio app that I skipped in my test program. Partly inspired by seeing "ATL" back in the symbols of modMessage, although it wasn't anywhere close. I added this as the first line in main():

   CoInitializeEx(NULL, COINIT_MULTITHREADED);

Badaboom,没有更多错误.如果您在UI线程的主线程上调用COINIT_APARTMENTTHREADED,请使用它.最后进行CoUninitialize()清理.

Badaboom, no more error. Use COINIT_APARTMENTTHREADED if you call this on the main thread of a UI thread. CoUninitialize() at the end to clean up.

解释起来很困难,使用MIDI时不必初始化COM.有了它,调用midiOutOpen会加载另一个DLL,clbcatq.dll.那是一个COM +支持模块.因此,肯定看起来像Win10需要COM进行初始化.

Explaining it is difficult, initializing COM should not be necessary when you use MIDI. With it in place, calling midiOutOpen gets one more DLL loaded, clbcatq.dll. That's a COM+ support module. So sure looks like Win10 requires COM to be initialized.

这篇关于使用Microsoft GS Wavetable Synth的Windows 10上的midiOutOpen失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆