views:

217

answers:

2

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

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.

A: 

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.

Sheng Jiang 蒋晟
A: 

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.

wqw