简体   繁体   English

使用DLCTL_NO_禁用VB6 WebBrowser控件中的图像,ActiveX等

[英]Disable Images, ActiveX Etc in VB6 WebBrowser control using DLCTL_NO_

Like the title says, i want to disable images, and ActiveX Controls in the vb6 webbrowser control using DLCTL_NO_RUNACTIVEXCTLS and DLCTL_NO_DLACTIVEXCTLS 就像标题中所说的,我想禁用图像,并使用DLCTL_NO_RUNACTIVEXCTLS和DLCTL_NO_DLACTIVEXCTLS禁用vb6 Webbrowser控件中的ActiveX控件

Microsoft talk about it here: http://msdn.microsoft.com/en-us/library/aa741313.aspx 微软在这里谈论它: http : //msdn.microsoft.com/en-us/library/aa741313.aspx

But i dont see any way to access IDispatch::Invoke from the vb6 application. 但是我看不到从vb6应用程序访问IDispatch :: Invoke的任何方法。

Any help would be greatly appreciated. 任何帮助将不胜感激。

I do not think VB6 let you to add the ambient properties. 我认为VB6不允许您添加环境属性。 Try host the ActiveX in another container (eg an ActiveX host written by yourself - but I do not know how much time you want to invest to declare VB-friendly OLE interfaces and implement them - or use another ActiveX like the one at http://www.codeproject.com/KB/atl/vbmhwb.aspx instead. 尝试将ActiveX托管在另一个容器中(例如,由您自己编写的ActiveX主机-但我不知道您要花费多少时间来声明和实现VB友好的OLE接口-或使用其他ActiveX,例如http:/ /www.codeproject.com/KB/atl/vbmhwb.aspx

You don't access IDispatch::Invoke in VB6, you just write you method and IDispatch is automagically implemented. 您无需访问VB6中的IDispatch :: Invoke,只需编写方法即可,IDispatch会自动实现。

Public Function DlControl() As Long
    DlControl = DLCTL_NO_DLACTIVEXCTLS Or ...
End FUnction

Then just open Tools->Procedure Attributes and for DlControl function open Advanced and assign Procedure ID to -5512 (DISPID_AMBIENT_DLCONTROL). 然后只需打开“工具”->“过程属性”,并为DlControl函数打开“高级”,并将过程ID分配给-5512(DISPID_AMBIENT_DLCONTROL)。 That's first part. 这是第一部分。

Second part is to set the client site to you custom implementation of IOleClientSite. 第二部分是将客户端站点设置为IOleClientSite的自定义实现。 You'll need a custom typelib, try Edanmo's OLELIB for declaration of these interfaces. 您将需要一个自定义的typelib,请尝试使用Edanmo的OLELIB声明这些接口。 Here is a delphi sample how to hook your implementation of IOleClientSite. 是一个delphi示例,该示例如何挂钩您的IOleClientSite实现。 Apparently you'll alse have to call OnAmbientPropertyChange at some point. 显然,您还必须在某个时候调用OnAmbientPropertyChange。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM