Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Catégorie:
Contrôles ActiveX en VFP
Titre:
Web browser control problem
Hello.
I have placed the web browser control on a VFP6.0 form and have successfully navigated to html pages that are generated in VFP at runtime. I put a Back, Forward and Home button in my html page. Notice I said on my html page and not on the VFP form. It is actually in a frame. What I want to do is to disable/enable those buttons as is appropriate. For example, if the user navigates to the Home page, I want to disable the Home button on the page.
I am using the NavigateComplete2 event of the browser object and checking the url parameter that is passed to that event. I know from the url that the user is either at the Home page or not. My problem occurs then I try to disable that button with code in the NavigateComplete2 event as follows:
"*** ActiveX Control Event ***
LPARAMETERS pdisp, url
this.document.frames(0).home.disabled = ("APP_MAIN.HTM"$UPPER(url))"
home is the name of the Home button in a frame. VFP errors out with:
"OLE error code 0x80020006:Unknown name."
If I suspend, go to the debugger and type in "this.document.frames(0).home.disabled" in the watch window, it shows ".F.". Obviously VFP knows about the object and its value. This even appears in the trace window as a tooltip when I hover over that line of code.
Does anyone know what is going wrong or what I need to do to avoid this problem? Am I using the wrong event to try to accomplish this? Any help is greatly appreciated.
TIA.
Mike
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement