DirectAudio problems...again

Started by
-1 comments, last by Laroche 21 years, 11 months ago
Im getting a strange error..but first let me tell you guys how everything is set up. I have 3 classes, CAudio, CMusic, and CSound..CAudio has the main performance and loader object, and CMusic and CSound have their own segments..What I want is to be able to call stuff like CMusic->loadfile(L"mymidi.mid") etc. Now i did what i wanted, and i get no compile or link errors. However, i get a "unhandled exception" and my app quits on me. Using the debugger, it says that my Loader, which is in my CAudio class, is causing the problem. I have a pointer to the CAudio object in my CMusic object, and here is where the program quits on me:
  
CMusic::SetSearchPath()
{
	// Set the search path

	char searchPath[MAX_PATH];
	WCHAR wSearchPath[MAX_PATH];
	GetCurrentDirectory(MAX_PATH, searchPath);
	MultiByteToWideChar(CP_ACP, 0, searchPath, -1, wSearchPath, MAX_PATH);
	if (FAILED(pDirectAudio->Loader->SetSearchDirectory(GUID_DirectMusicAllTypes, wSearchPath, FALSE)))
	{
		MessageBox(NULL, "SetSearchDirectory Failed", "damn", MB_OK);
	}
	return (TRUE);
}
  
the loader is a public member in CAudio.. If anyone could help me I''d be eternally grateful
Check out my music at: http://zed.cbc.ca/go.ZeD?user_id=41947&user=Laroche&page=content

This topic is closed to new replies.

Advertisement