martijn_himself
martijn_himself

Reputation: 1570

How do I troubleshoot a COM component?

My apologies for the vagueness of this question.

During the migration of an application to a new server environment, a COM component (.dll) file that exposes an API for the application has stopped working.

Is there any way I can troubleshoot a COM component? Is there standard way for a COM component to log faults (there are no events in the Windows Event Viewer)? Can I 'inspect' a component in any way?

I have successfully registered the component using regsvr32.exe (I have no idea what this actually does other than creating some Windows Registery settings).

Martijn

Upvotes: 0

Views: 86

Answers (1)

mksteve
mksteve

Reputation: 13073

There are 2 parts to this form of troubleshooting.

Firstly use procmon from SYS internals. SYS internals This shows strace like behaviour of the processes trying to open COM server.

Look at failed function calls.

Next I would try to load the com control directly in a debugger, see any failures there

The results from procmon will show the registry locations and file locations which are key to loading the com object.

Failures could be :-

  1. Installed for one user, instead of all-users. This would fail to find named object
  2. Incorrect architecture. If prog.exe went to 64bit, it will fail to load 32 bit com DLL
  3. Missing dependencies. Further DLLs may be unloadable - these will show up in procmon trace
  4. Config data. If further config is required by com DLL, then this will show up either in events in procmon, or in errors in debugger

You can load any DLL in debugger. Debug symbols makes it easier, but we are trying to spot errors, exceptions in the calls it makes

Upvotes: 1

Related Questions