Rob Carnev

Rob Carnev

  • NA
  • 1
  • 11.3k

Late Binding and OLE Automation

Oct 11 2010 12:13 PM

Hi Everybody,
  I'm really a newby in C#!!! I'm trying to inspect an OLE automation library connected in Late Binding "mode".
From the beginning: I have an industrial simulator that exposes a number (thousands...) of classes and interfaces...
I need to make a debug tool to start interacting in OLE Automation with this complex object. I would like to inspect classes and ask to the object (or the class) it's own properties, and when listed ask the value to everyone.
I can ask the value when I have the name of the property: with an InvokeMethod... but I cannot find a piece of code to retrieve a list of properties and method of the specialized class...
Example:
Application app = new Application();  //I retrieve a "poiter" to active app
Flow f=app.getFlowsheet[0].getFlow[0] //I retrieve the flow
PropertiesInfo[] pArray = f.XXXXXXXX      <-----that's the problem
foreach (PropertyInfo pInfo in pArray) {
   pInfo.InvokeMethod....    <----etc.  this works!
}
If I do not ask anything before getting the enumerator ( getProperties() ) I receive nothing because the "Late Binding" do not populate the class at compile time and nothing is ready. The other way is to write a dictionary of milion (I do not exagerate) of properties!
I hope there is a technicality to bind all the methods and properties in order to inspect (during a late binding session) without calling it once atime everyone!
Please halp me I googled 3 days!
Rob

Answers (1)