查找ActiveX组件的所有属性 [英] Find all properties of an ActiveX component

查看:317
本文介绍了查找ActiveX组件的所有属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图环顾四周,但不能说服自己一个答案,因为COM / ActiveX的世界似乎很混乱。

基本上我想知道的是,给定GUID,是有没有办法知道所有的接口,属性和方法暴露的ActiveX控件?
我读到某个地方,你只需要问一个特定的属性是否有。但是我怎么知道一个属性之前知道什么?

我猜IDispatch做类似的东西,但我不能弄清楚如何使用它。如果这是一个工作,一个小片段,最好是在C#将帮助我更好地理解。

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.

感谢

推荐答案

p>

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

在C#中,您可以使用 Type.GetMembers Method

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

这篇关于查找ActiveX组件的所有属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆