I'm trying (without luck) to implement an "Object Dumper" for objects I'm accessing in the Office Type Library.
It must be possibly, because VS's debug window has a "dynamic view" for the System.__ComObject objects that effectively does what I want.
Any ideas?
I have also created a method for getting an interface that can be used for accessing the object. Use:
You have to have an IDispatch interface in your code:
My method casts COM object to IDispatch, gains unmanaged type info, gets object type GUID from non-public Marshal method GetTypeInfoGuid and then searchs it in current AppDomain's assemblies.
If the appropriate type isn't found, the method will return type of System.__ComObject. However, you can get GUID property value from it, so at least you will get the GUID. Usage:
Hope this helps. Good luck. ☺
Edit: Found an easier but slower method: