Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find all properties of an ActiveX component

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

like image 457
user1740173 Avatar asked Jan 19 '13 05:01

user1740173


People also ask

What are the properties exposed by ActiveX controls?

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.

How do I find ActiveX control settings?

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.

How do I test ActiveX controls?

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.

How do I find ActiveX controls in Excel?

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.


1 Answers

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.

like image 189
Alexan Avatar answered Sep 22 '22 16:09

Alexan