I have an old game which plays MIDI files with the following:
IDirectMusicPerformance8* m_pDMPerformance;
IDirectMusicLoader8* m_pDMLoader;
CoCreateInstance(CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC, IID_IDirectMusicLoader8, (void**)&m_pDMLoader);
CoCreateInstance(CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC, IID_IDirectMusicPerformance8, (void**)&m_pDMPerformance);
m_pDMPerformance->InitAudio(NULL, NULL, m_hWnd, DMUS_APATH_SHARED_STEREOPLUSREVERB, 128, DMUS_AUDIOF_ALL, NULL);
This results in MS GS Wavetable Synth + reverb, no matter what the user's configuration. I need to be able to output proper raw MIDI to the default MIDI device, which, in the case of some savvy users, is a softsynth like VirtualMidiSynth or FluidSynth, an MT-32 emulator, an OPL3 emulator, or even a hardware device with its own onboard samples such as a real MT-32. Choosing device within the application is not necessary--I'd rather just have it select the default/#0 MIDI device and send raw MIDI to it. The .mid files themselves are standard and play wonderfully in other media players which output raw MIDI to either the device of the user's choice, or the default/#0 device.