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
Properties are data members of the ActiveX control that are exposed to any container. Properties provide an interface for applications that contain ActiveX controls, such as Automation clients and ActiveX control containers. Properties are also called attributes.
Use the following instructions to enable or disable ActiveX controls in the Trust Center. Click File > Options. Click Trust Center > Trust Center Settings > ActiveX Settings. Click the options you want, and then click OK.
To test your ActiveX controlIn the Insert Control box, select the desired control and click OK. The control will appear in the control container. If your control is not listed in the Insert Control dialog box, make sure you have registered it with the Register Controls command from the File menu of Test Container.
On the Developer tab, in the Controls group, click Insert, and then under ActiveX Controls, select a control, or click More Controls to view all the available ActiveX controls, and then select a control.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With