Alright so I am attempting to initialize direct music via the COM interface exactly as it appears on MSDN. My function looks like this:
Code:
HRESULT CDirectX::initDirectSound (HWND hwnd) {
_Performance = NULL;
_Loader = NULL;
CoInitialize(NULL);
CoCreateInstance(CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC, IID_IDirectMusicLoader8, (void**) &_Loader);
if(_Loader = NULL)
return E_FAIL;
CoCreateInstance(CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC, IID_IDirectMusicPerformance8, (void**)& _Performance);
if(_Performance = NULL)
return E_FAIL;
_Performance->InitAudio(NULL, NULL, hwnd, DMUS_APATH_SHARED_STEREOPLUSREVERB, 64, DMUS_AUDIOF_ALL, NULL);
_Loader->SetSearchDirectory (GUID_DirectMusicAllTypes,
L"C:\\Documents and Settings\\Andrew Hunter\\My Documents\\My Music",
FALSE );
return S_OK;
}
The problem is that _Loader never appears to become initialized, aka the program halts and the value of _Loader is NULL. Has anyone seen this before?