从 Interop 对象获取动态成员和 SetValue
我有一个作为 System.__ComObject 出现的互操作对象,我想使用变量名称设置值:
SetValue(fieldname) = fieldvalue;
我还需要检查动态成员以查看可用的内容。一些成员(以 Ref 结尾的成员)有子成员,因此我也需要深入了解他们。
在调试中,动态成员如下所示。 (抱歉,我无法发布图像)
I have this Interop Object that comes up as a System.__ComObject and I want to set values using a variable name:
SetValue(fieldname) = fieldvalue;
I also need to inspect the dynamic members to see what’s available. Some members (the ones ending in Ref) have sub-members so I need to drill-down to them as well.
In debug, the dynamic members come up as follows. (sorry,i can't post the images)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用即席界面,我可以通过以下方式收集动态成员:
然后我可以使用变量成员名称:
一个大大的“谢谢!” Impromptu Interface 的开发者为我解答了这个问题。
Using the Impromptu Interface I was able gather the dynamic members with:
Then I can set using a variable member name with:
A big "Thank You!" to the developer of the Impromptu Interface for answering this for me.