尝试将我发现的下一个代码here转换为VBA ...
typedef struct {
WORD wMid;
WORD wPid;
MMVERSION vDriverVersion;
TCHAR szPname[MAXPNAMELEN];
WORD wTechnology;
WORD wVoices;
WORD wNotes;
WORD wChannelMask;
DWORD dwSupport;
} MIDIOUTCAPS;
我在VBA上使用了它
' MIDI output device capabilities structure
Public Structure MIDIOUTCAPS
Dim wMid As Short ' Manufacturer ID
Dim wPid As Short ' Product ID
Dim vDriverVersion As Integer ' Driver version
Dim szPname As String ' Product Name
Dim wTechnology As Short ' Device type
Dim wVoices As Short ' n. of voices (internal synth only)
Dim wNotes As Short ' max n. of notes (internal synth only)
Dim wChannelMask As Short ' n. of Midi channels (internal synth only)
Dim dwSupport As Integer ' Supported extra controllers (volume, etc)
EndStructure
但是它到处都会出错!看来VBA毕竟不接受公共结构!
目标是通过以下功能使用该结构:
Declare Function midiOutGetDevCaps Lib "winmm.dll" (ByVal uDeviceID As Integer, ByRef lpCaps As MIDIINCAPS, ByVal uSize As Integer) As Integer
有关如何获取Midi设备描述的帮助吗?
谢谢