开发者

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_N开发者_如何学编程O_RUNACTIVEXCTLS and DLCTL_NO_DLACTIVEXCTLS

Microsoft talk about it here: http://msdn.microsoft.com/en-us/library/aa741313.aspx

But i dont see any way to access IDispatch::Invoke from the vb6 application.

Any help would be greatly appreciated.


I do not think VB6 let you to add the ambient properties. Try host the ActiveX in another container (e.g. 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.


You don't access IDispatch::Invoke in VB6, you just write you method and IDispatch is automagically implemented.

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). That's first part.

Second part is to set the client site to you custom implementation of IOleClientSite. You'll need a custom typelib, try Edanmo's OLELIB for declaration of these interfaces. Here is a delphi sample how to hook your implementation of IOleClientSite. Apparently you'll alse have to call OnAmbientPropertyChange at some point.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜