Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WebBrowser control events
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
WebBrowser control events
Miscellaneous
Thread ID:
00700800
Message ID:
00700800
Views:
54
I'm trying to bind to the events raised by the webbrowser control (c:\windows\system32\shdocvw.dll) in my app. As a test, I dropped the browser control on a form, added a NODEFAULT to Refresh(), added a button that calls the Navigate2() method of the oleControl to navigate to a page. I dropped the DWebBrowserEvents2 icon from the object browser into a edit window to let it create the stub code for the interface. My code now looks like:
SET CLASSLIB TO webtest ADDITIVE

ox = CreateObject("WebTest")
x=NEWOBJECT("myclass")

ox.Show()

EVENTHANDLER(ox.oleControl1.Object, x)

READ EVENTS
When I click on the form button (that navigates to my test page), it fails with a "Must specify additional parameters" error on the FileDownload event, which looks like:
PROCEDURE DWebBrowserEvents2_FileDownload(Cancel AS Logical @) AS VOID;
 				HELPSTRING "Fired to indicate the File Download dialog is opening"
	* add user code here
ENDPROC
I looked up the events of this control in MSDN and this is the correct method signature. I also opened this DLL in the OLE/COM Object Viewer included with Visual Studio, and looked at the type library of it. This particular event looks like:
 [id(0x0000010e), helpstring("Fired to indicate the File Download dialog is opening")]
            void FileDownload([in, out] VARIANT_BOOL* Cancel);
So, as far as I can tell, the VFP code should work. If I ignore the error, it continues working and navigates to the page correctly.

Does anyone have any ideas on how to get this to work?
-Paul

RCS Solutions, Inc.
Blog
Twitter
Reply
Map
View

Click here to load this message in the networking platform