CoCreateInstance failing
-
Hi, My dev environment is VC++ .NET 2005 with MFC. So here's the deal: From my main application, I load up a number of dlls as COM objects with CreateInstance. - These dlls are all registered. - Everything works perfectly when the dlls are compiled in debug mode. - When the dlls are compiled in release mode, CreateInstance fails to load one of the dlls from my main application, returning error -2147221164, CLASS_NOT_REGISTERED. This only happens with one dll - if I replace that dll with a debug version of the same dll, everything works fine. I don't have any #ifdef _DEBUG sections in the dll code. Has anyone seen this before or know what might be wrong?
KR
-
Hi, My dev environment is VC++ .NET 2005 with MFC. So here's the deal: From my main application, I load up a number of dlls as COM objects with CreateInstance. - These dlls are all registered. - Everything works perfectly when the dlls are compiled in debug mode. - When the dlls are compiled in release mode, CreateInstance fails to load one of the dlls from my main application, returning error -2147221164, CLASS_NOT_REGISTERED. This only happens with one dll - if I replace that dll with a debug version of the same dll, everything works fine. I don't have any #ifdef _DEBUG sections in the dll code. Has anyone seen this before or know what might be wrong?
KR
-
Hi, My dev environment is VC++ .NET 2005 with MFC. So here's the deal: From my main application, I load up a number of dlls as COM objects with CreateInstance. - These dlls are all registered. - Everything works perfectly when the dlls are compiled in debug mode. - When the dlls are compiled in release mode, CreateInstance fails to load one of the dlls from my main application, returning error -2147221164, CLASS_NOT_REGISTERED. This only happens with one dll - if I replace that dll with a debug version of the same dll, everything works fine. I don't have any #ifdef _DEBUG sections in the dll code. Has anyone seen this before or know what might be wrong?
KR
KellyR wrote:
I don't have any #ifdef _DEBUG sections in the dll code.
And haven't you ASSERT at all (or have you only harmless ASSERT, i.e. without meaningful code inside)? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
Hi, My dev environment is VC++ .NET 2005 with MFC. So here's the deal: From my main application, I load up a number of dlls as COM objects with CreateInstance. - These dlls are all registered. - Everything works perfectly when the dlls are compiled in debug mode. - When the dlls are compiled in release mode, CreateInstance fails to load one of the dlls from my main application, returning error -2147221164, CLASS_NOT_REGISTERED. This only happens with one dll - if I replace that dll with a debug version of the same dll, everything works fine. I don't have any #ifdef _DEBUG sections in the dll code. Has anyone seen this before or know what might be wrong?
KR
-
KellyR wrote:
I don't have any #ifdef _DEBUG sections in the dll code.
And haven't you ASSERT at all (or have you only harmless ASSERT, i.e. without meaningful code inside)? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
Well it's just a CreateInstance call with a CLSID. It's like this: m_Server.CreateInstance(SERVERLib::CLSID_Server); And the CLSID passed into the function is correct in both debug and release versions. The dll is registered, I just don't understand why it won't load in release mode.
KR
-
Have a look at http://www.flounder.com/debug_release.htm[^]. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
Hi, My dev environment is VC++ .NET 2005 with MFC. So here's the deal: From my main application, I load up a number of dlls as COM objects with CreateInstance. - These dlls are all registered. - Everything works perfectly when the dlls are compiled in debug mode. - When the dlls are compiled in release mode, CreateInstance fails to load one of the dlls from my main application, returning error -2147221164, CLASS_NOT_REGISTERED. This only happens with one dll - if I replace that dll with a debug version of the same dll, everything works fine. I don't have any #ifdef _DEBUG sections in the dll code. Has anyone seen this before or know what might be wrong?
KR
I think you need to have the MFC Dlls for VS2005 in the system where you are testing the app. However if you are testing it in the same system where VS 2005 is installed there is some other problem
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
-
Have a look at http://www.flounder.com/debug_release.htm[^]. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke