Paul Vicenti
Paul Vicenti

Reputation: 135

Tracking COM object error in application

I was using an application and it was working perfect. After some months of not using it, I tried to run it and it doesn't work. It shows a message box saying that it cannot instance a COM object.

Do any know how to track errors in COM objects?

Upvotes: 1

Views: 163

Answers (2)

Pablo Yabo
Pablo Yabo

Reputation: 2813

You can use ProcessMonitor and try to find the registry key that may be incorrect. The other option is to use http://www.moduleanalyzer.com, it intercepts CoCreateInstance showing all created COM objects and the return values.

Upvotes: 1

Coder
Coder

Reputation: 3715

Run Depends tool on COM object DLL to verify it has all the necessary dlls, re-register the COM dll/exe.

Any HRESULTS from debugging/logs? Any changes in apartment models?

You cannot change the apartment type once you've set one. So if the object cannot use one of the models and you try to CoCreate it, it will fail. That's why you never call CoInit from inside DLL main thread.

Upvotes: 1

Related Questions