Find all properties of an ActiveX component
Asked Answered
O

3

5

I tried looking around but was not able to convince myself with an answer as the world of COM/ActiveX seems to be very confusing.
Basically what I want to know is, given the GUID, is there a way to know all the interfaces, properties and methods exposed by an ActiveX control? I read somewhere that you just have to ask if a particular property is there or not. But how do I ask about a property before knowing what are there?
I guess IDispatch does something similar, but I am not able to make out how to use it. If this is the one that works, a small snippet, preferably in C# would help me understand better.

Thanks

Oodles answered 19/1, 2013 at 5:2 Comment(0)
B
6

You can use PowerShell for this:

$a = new-object -comobject ProgId
#get properties
$a | Get-Member -membertype properties 
#or get all members
$a | Get-Member

And in C# you can use Type.GetMembers Method.

Byerly answered 20/8, 2014 at 16:38 Comment(0)
M
0

ActiveX controls don't have to be self-descriptive and be capable to enumerate supported interfaces and/or properties. As other COM classes they implement certain interfaces and being implementing a certain set of mandatory interfaces they are good for embedding into host application. That is, you might end up being unable to find properties for a certain valid ActiveX Control.

Quite so often though, you can succeed with this tasks if given control does what most of controls do. Control's COM Class typically has a typelibrary you can discover by looking at registry reference, or IProvideClassInfo interface. From there on when you hold ITypeInfo interface, you can locate IDispatch derived interfaces of the class, and then enumerate properties and method using the type library, which holds this information.

Marnimarnia answered 19/1, 2013 at 23:9 Comment(0)
W
0

You can use the OLE/COM Object Viewer in Microsoft's Resource Toolkit. That will list all properties/methods/events/etc.

Woodborer answered 7/3, 2013 at 17:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.