I have an MFC app that I am trying to port over to XAudio2 rather than waveOut* (waveOut has SERIOUS problems under Vista and Windows 7 that don't exist under XP :()
Now I note that XAudio2 requires that you initialise COM with the Multithreaded model. MFC (OLE specifically it seems), on the other hand, requires that you initialise COM as apartment threaded. Is there any way around this problem?
I'm assuming this is the cause of my crash as it seems somewhere internal to XAudio its crashing. It seems that one of the 4 threads created when I initialise XAudio2 is making an invalid jump. In fact the thread that is going wrong is the thread whose stack, after initialisation, points to the XAudio dll. I have spent many hours going over this code and I can only guess that the invalid is occurring as a result of the threading model.
Might I have to do something truly silly like seperating all audio calls into a seperate thread and pushing messages across to that thread? I'd really rather not do this.
Any help would be HUGELY appreciated.