1

我已使用此链接中的以下代码。

从 C# 中的 MIDI 端口获取信号

我想知道我需要添加什么才能获得设备名称列表。我查看了 MSDN 网站,发现我需要实现midiInGetDevCaps及其关联的结构。但是我以前从未真正对 dll 导入和结构做过任何事情,所以我有点迷茫。

4

1 回答 1

4

也许你需要像这样使用它:

MIDIINCAPS caps2;

for (uint i = 0; i < Device.iNumDevs1; i++)
{
    Device.midiOutGetDevCaps(i, out caps2, Marshal.SizeOf(output));
    comboBox2.Items.Add(caps2.szPname);
}
于 2010-05-13T14:27:04.000 回答