从UWP调用Windows DLL会产生与经典桌面应用程序不同的结果 [英] Calling a Windows DLL from UWP yields different results than from classic desktop apps

查看:84
本文介绍了从UWP调用Windows DLL会产生与经典桌面应用程序不同的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请原谅我的基本知识,这是我的第一个UWP项目。

please excuse my rudimentary knowledge, this is my first UWP project.

我在winmm中调用函数.dll,特别是来自UWP应用程序的midiOutGetNumDevs(),它显然产生的结果与从Windows Forms应用程序调用midiOutGetNumDevs()产生的结果不同,后者产生正确数量的MIDI设备。我想知道两个
程序是否都调用了不同的winmm.dll,但我没有设法找出他们实际调用的是哪个dll。是否可以编写一个包装器来使用UWP应用程序中的非UWP调用?

I'm calling functions in winmm.dll, specifically midiOutGetNumDevs(), from a UWP app, which apparently yields different results than calling midiOutGetNumDevs() from a Windows Forms app, which yields the correct number of MIDI-devices. I'm wondering if both programs call different winmm.dll's, but I did not manage to find out which dll's they are actually calling. Is it possible to write a wrapper to use the non-UWP calls in the UWP app?

任何想法可能是什么问题?

Any ideas what the problem could be?

最好的问候,

Max

Best regards,
Max

推荐答案

Hi Max,

Hi Max,

首先,并非所有桌面API都可用于UWP应用程序。您正在使用的API:  midiOutGetNumDevs function ,它旨在仅用于桌面应用程序。
因此它无法用于UWP应用程序,这可能是您在UWP应用程序和Windows窗体应用程序中获得不同结果的原因。

First of all, not all desktop APIs could be used in UWP apps. The API you are using: midiOutGetNumDevs function, it designed to be used only in desktop app. So it could not be used to to UWP apps, it could be the reason that why you got different results in UWP apps and Windows Forms apps.

我的建议是你可能需要使用UWP API来获取MIDI设备。您可以参考以下链接: UWP中的MIDI  

My suggestion is that you might need to use UWP APIs to get MIDI devices. You could refer this link:MIDI in UWP 

祝你好运,

Roy


这篇关于从UWP调用Windows DLL会产生与经典桌面应用程序不同的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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