>I placed a web browser active X control onto a form in VFP
>then i tried running the form.
>I received an OLE error message as the form started up and
>in place of the location of the web browser control i got a blank white box.
>I had an internet connection running when I ran the form.
>
>Are there some steps I must take to set up the web browser control properly ?
>
>TIA
Since the native VFP OLEControl container has a method named Refresh, this method is called when form.Refresh is called. VFP forms call their own refresh method automatically after the init method runs, and so VFP calls the WebBrowser control's Refresh method. This would normally be ok, except that the WebBrowser control has its own refresh method that is used to refresh the currently loaded page. When the form starts, no pages is yet loaded, and so calling the Refresh method causes an error. If you load a page at form startup, you can prevent this error by waiting until the page is finished loading (Poll oIE.readyState, and then oIE.document.readyState) before allowing the form.init method to finish.
Alternatively, like David said, you can put a NODEFAULT in the control's refresh() method, but this permanently disables that method for the life of the control(which might be fine for your application).
To get the best of both worlds, you can put code in the control's refresh method that issues a NODEFAULT if the control is not ready to be refreshed:
IF !THIS.ReadyState = 4
NODEFAULT
ENDIF
Erik Moore
Clientelligence