   DirectMusic: strange happening
  Problem: After initializing DirectMusic, I load a sound and immediately play it.  Then I wait for 2 seconds and exit the program (to make sure I don't exit before the sound plays).  From time to time, the sound segment does not play.  This used to happen 80% of the time, but for some reason, only happens 20% of the time now.  It only seems to happen with the first sound played, and only if I play it quickly.  For example, if I wait for 2 seconds then play another sound, the 2nd sound always plays as expected.  This bug is file and compression scheme independent.  All of my sound files are .wav files.Do I need to change the SetCooperativeLevel?  I don't have a pointer to the DirectSound interface because I am strictly dealing with DirectMusic.  On my call to InitAudio (to create a default audio path), I pass 0 as the HWND parameter.  I'm developing a little sound engine in console mode for now, but I could pass it the HWND when the engine is integrated.  This HWND parameter is what the DirectMusic Performance object uses to set the cooperative level.  This has never been a problem before, but this is the only reason I can think of that the sounds aren't playing.Let me show you a bit of pseudo code, tell me if you spot anything out of place://init. direct musicCOM initializeCreate DirectMusic loaderCreate DirectMusic performanceInitAudio to create a default audio pathSetSearchDirectory to my sound directory//for each soundCreate music segmentLoad music segment from file with the DirectMusic loaderDownload the wave data into the performancePlay the sound with PlaySegmentEx* (see note at the end)//cleanup(You can assume I do all this fine)The only thing I don't fully understand is why the loader takes in a pointer to my segment pointer (as if it is creating the segment?).  Is this right://for each soundCoCreateInstance(CLSID_DirectMusicSegment, 0, CLSCTX_INPROC, IID_IDirectMusicSegment8, (void**)&mysegment).DirectMusicLoader->LoadObjectFromFile(CLSID_DirectMusicSegment, IID_IDirectMusicSegment8, wfilename, (void**)&mysegment);mysegment->Download(DirectMusicPerformance);So why does the CoCreateInstance function AND the loading function take a pointer to my pointer?... it seems like I'm creating the variable twice.*Note at the end: So I took this flag out of my call to PlaySegmentEx - DMUS_SEGF_SECONDARY.  This fixed the problem, but it is an unacceptable solution because I will need multiple sounds playing at once, and thus, they can't all be primary segments.So that leads to the question: Do I need a primary segment at all?  Is there anything wrong with using all secondary segments?  Or is that why my original sound did not play sometimes, because no primary segment was playing, thus there was nothing to mix with?Help, haha... sorry for the long post.  Thanks for any help.   
  Nope, turns out that doesn't fix the problem.  Playing the initial sound with no flags (setting it to be the primary segment) does not guarantee that the sound plays.Also, what is the difference between a primary and 2ndary segment?The only differences I see:The flag passed to PlaySegment or PlaySegmentEx.A primary segment does not mix with the currently playing primary segment.Tempo changes on 2ndary segments are ignored.Anything else?Edit: Oh yeah, and I'm pretty sure I am NOT supposed to create the segment before calling DirectMusicLoader->LoadObjectFromFile(...).  Thats the 2nd time I've found a bug in the Two Kings tutorials @ two-kings.de   