The application should call MIDIQueryNumInstances to retrieve the number of instances and initialize ulNumInstances with this value.
The instance names of hardware nodes are defined by device drivers.
The application should provide a user-driven method to refresh the list of instances. The selection of instances can change at any time. Generally, an application would only call MIDIQueryInstanceList to obtain the list of hardware nodes; instances of other classes are usually not of interest. Therefore, this function should be called every time the application wants to present a list of available hardware nodes to the user. This ensures that the list is always up to date.