views:

36

answers:

3

Hello guys.

I work alot with ArcObjects, ESRI's API to program for ArcGIS applications.

I would like to know if there is a tool where I can inspect what COM objects are alive or are on stack.

I already know to free them, but I would to inspect each method to see if there are any leftovers.

+1  A: 

As far as I know, there's no such tool. At the lowest level, a COM object is just a specific binary layout of the memory. How and where that memory is allocated is up to the code that implements the COM object. Any tool would be able to inspect only the memory for COM objects it cocreated. Actually, it'll be able to inspect only COM objects in the same apartment, for any other it'll be able to inspect the proxy only.

Also, COM objects are never [*] allocated on the stack; they are always allocated in the heap.

[*] though ATL's CComObjectStack<> is quite handy for unit testing purposes.

Franci Penov
hello Franci. I'll give it a try! It's better then nothing :D
George
+1  A: 

Randomly typing in "COM Inspector" in Google produced this link. Looks good, no personal experience. Run this query yourself to find others.

Hans Passant
+1  A: 

If you're using .NET, you should be loop through all assemblies that have been loaded using AppDomain.CurrentDomain.GetAssemblies.

To see what extensions are loaded use IExtensionManager to loop through extensions.

Seeing what commandbars are loaded is a bit more complicated.

Kirk Kuykendall
thanks for the arcobjects specific answer :P
George