1

I have a third party DLL made in C++ and i can't figure out how to get it's properties. i can see them with quick watch but there is so much properties that i have difficulty moving with the scroll bar. probably somewhere around 6000 properties. I don't feel like writing them 1 by one and i am trying to access them via reflection so i can dump all that in a bag and user will choose later on what to show and what not.

The problem is that these property somehow don't show under the standard reflection command GetProperties();

if tried the following just too see :

PropertyInfo[] pi = o.GetType().GetProperties();
MemberInfo[] mi = o.GetType().GetMembers();
MethodInfo[] mti = o.GetType().GetMethods();

none of them contain something intelligent. I did found the property under Object / Base / DynamicView under the quick watch.

Base would be type of : ((System.MarshalByRefObject)(((System.__ComObject)(o))))

Knowing that i have no clue how to use reflection to get list of properties within Dynamic View

Franck
  • 4,438
  • 1
  • 28
  • 55
  • 1
    possible duplicate of [Get property names via reflection of an COM Object](http://stackoverflow.com/questions/10615019/get-property-names-via-reflection-of-an-com-object) – D Stanley Oct 02 '13 at 14:04
  • The problem is not that you've used `dynamic` so much as that the underlying object is a COM object, which isn't fully exposed through reflection.. – D Stanley Oct 02 '13 at 14:12
  • I apparently didn't had the proper search terms. But the dispatch marshaller did the trick. In the end i ended up with 8223 properties which is more than my wild guess. Just to add i did reflection over Com DLL before but this is the first one that exposed dynamically their methods and properties. – Franck Oct 02 '13 at 14:23

1 Answers1

0

D-Stanley comment pointed me in the good direction. I found the solution following couple links from there. Didn't had the exact same problem but close enough and it solved mine.

Solution here : Reflection with IDispatch-based COM objects

Franck
  • 4,438
  • 1
  • 28
  • 55