Jump to content
  • Advertisement
Sign in to follow this  
HeWhoDarez

CoCreateInstance: CLSCTX_INPROC ?

This topic is 3439 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 guys, Have been working through numerous tutorials in relation to DX inparticular DirectMusic from Mason McCuskeys Game Audio Programming. Have hit a snag that I cant see the problem for. Unhandled exception at 0x76dce1bf in Communicate.exe: 0xC0000005: Access violation writing location 0x00000008 <code> ============================================================================== CoCreateInstance(CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC, IID_IDirectMusicLoader8, (void**)&m_Loader); =============================================================================== </code> It seems that CLSCTX_INPROC is not one of the enumerations at msdn, do any of you guys use it or know of an alternative? The tutorial says that this is used to ensure the object shares the same address space but surely that is why I am getting this exception?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by HeWhoDarez
Hi guys,

Have been working through numerous tutorials in relation to DX inparticular DirectMusic from Mason McCuskeys Game Audio Programming.

Have hit a snag that I cant see the problem for.

Unhandled exception at 0x76dce1bf in Communicate.exe: 0xC0000005: Access violation writing location 0x00000008

<code>
==============================================================================

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

===============================================================================
</code>


It seems that CLSCTX_INPROC is not one of the enumerations at msdn, do any of you guys use it or know of an alternative?

The tutorial says that this is used to ensure the object shares the same address space but surely that is why I am getting this exception?
Your this pointer is null, and your m_Loader variable is 8 bytes from the start of your class.

Look up the call stack to see where the class is allocated, and make sure it's not failing.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!