Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

midiOutGetID

Posted on 1998-01-31
2
Medium Priority
?
300 Views
Last Modified: 2012-08-14
I need to know how to get the handle of midi output devices on my machine, for the midiOutGetID.
I use midiOutGetNumDevs to get to know how many devices I have available.
What do I do now?
How do I get their handles?
thank you.
CATT.
0
Comment
Question by:CATT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
Future earned 160 total points
ID: 1454720
Write a function similar to this.  You would use MidiOutGetDevCaps to get the capabilities of each device.
Add the following types and declarations to your program. The ID for the MIDI Mapper is always -1.  Hope this is enough to get you started.

Declare Function midiOutGetDevCaps Lib "winmm.dll" Alias "midiOutGetDevCapsA" (ByVal uDeviceID As Long, lpCaps As MIDIOUTCAPS, ByVal uSize As Long) As Long

Type MIDIOUTCAPS
        wMid As Integer
        wPid As Integer
        vDriverVersion As Long
        szPname As String * 32
        wTechnology As Integer
        wVoices As Integer
        wNotes As Integer
        wChannelMask As Integer
        dwSupport As Long
End Type


Function GetSoundBoardMIDIAudioID()  'looks for "synth" as output                                      'device
  Dim NumAuxDevs As Long
  Dim DevNum As Long
  Dim DevCaps As MIDIOUTCAPS
  Dim retval As Long, Pos As Long

  NumAuxDevs = midiOutGetNumDevs()
  GetSoundBoardMIDIAudioID = MIDI_MAPPER
  For DevNum = 0 To (NumAuxDevs - 1)
    retval = midiOutGetDevCaps(DevNum, DevCaps, 92)
    Pos = InStr(LCase$(DevCaps.szPname), "synth")
    If Pos <> 0 Then
      GetSoundBoardMIDIAudioID = DevNum
      Exit Function
    End If
  Next DevNum
End Function
0
 

Author Comment

by:CATT
ID: 1454721
No prob.  BTW, one thing you should add is PUBLIC MIDI_MAPPER = -1& along with your declarations.  Or just use -1 for the device ID instead of bothering with any of this, as far as I know all systems have the MIDI mapper installed as an output device.

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question