Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

imDivineLight

Wierd OLE32 Access voilation, please help!

This topic is 5199 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I have been coding sound core for many hours, and at the end i am getting access voilations, please see the following code:
bool cSoundCore::Init( HWND hWnd )
{
	CoInitialize(NULL);
  
        // This mad func causes error.

	CoCreateInstance(CLSID_DirectMusicLoader, NULL, 
		CLSCTX_INPROC, IID_IDirectMusicLoader8,
		(void**)&mpDMLoader);

	CoCreateInstance(CLSID_DirectMusicPerformance, NULL,
		CLSCTX_INPROC, IID_IDirectMusicPerformance8,
		(void**)&mpDMPerformance );

	// Initialize DirectMusic and DirectSound

	mpDMPerformance->InitAudio(	NULL, NULL, hWnd, 
		DMUS_APATH_DYNAMIC_STEREO, 64, DMUS_AUDIOF_ALL, NULL);

	// Set search directory as current directory

	char szSearchPath[MAX_PATH];

	GetCurrentDirectory(MAX_PATH,szSearchPath);
	SetSearchDirectory(szSearchPath);

	return true;
}
now i have tried every thing, i have checked MS docs they all do like this, i even copied & pasted their code, but still the same error, i think OLE32 is COM thing, & i may have been doing something wrong with COM please tell me whats wrong here!

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!