转换 System.ComObject 不再有效
我刚刚安装了 ie9,现在我的程序使用 mshtml 的 IHTMLStyle 不再可以转换。
所以我几乎已经拥有
class Style { mshtml.HTMLStyle mStyle; Style(mshtml.IHTMLStyle style) { mStyle = style as mshtml.HTMLStyle } }
并且它曾经有效,但现在 mStyle 总是最终为空。我尝试进行显式转换,即 (mshtml.HTMLStyle)style,但最终不起作用,因为它说样式的实际类型是 System.__ComObject,而我知道它在安装 ie9 之前可以很好地转换。
这听起来像其他人遇到过的事情吗?
I've just installed ie9 and now my program using mshtml's IHTMLStyle no longer can be casted.
so I pretty much had
class Style { mshtml.HTMLStyle mStyle; Style(mshtml.IHTMLStyle style) { mStyle = style as mshtml.HTMLStyle } }
and it used to work, but now mStyle always ends up being null. I tried doing an explicit cast, i.e. (mshtml.HTMLStyle)style, but that ended up not working because it says that the actual type of style is a System.__ComObject when I know it used to cast just fine before I had ie9 installed.
does this sound like anything anyone else has run into?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
稍后使用“dynamic”绑定
像这样 :
Use later binding with 'dynamic'
like this :