Sign in to follow this  
HeWhoDarez

CoCreateInstance: CLSCTX_INPROC ?

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this