Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Difficulty with browser control
Message
From
03/10/2008 12:17:48
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01352564
Message ID:
01352589
Views:
19
The navigator is timing out, even when I increase time to 8 seconds, but only sometimes (often).

What could be causing the problem? Maybe some properties are set wrong? I created the class some time ago and haven;t used it much.

Thanks for the help,

Alex

>The WaitForReadyState(0 should be right after Navigate(). Only after that you can be sure that content has been downloaded.
>
>>
>>I am having difficulty with web browser control on a form. Picture shows well when I trace but only intermitently when running. I am using the code below. Any ideas?
>>
>>TIA,
>>
>>Alex
>>
>>
>>*Method ShowMapFromHTML of a container that contains oBrowser (browser ActiveX)
>>LPARAMETERS tcHTML
>>LOCAL lcFileType,lcTempFile
>>IF This.Visible
>>	This.oBrowser.Navigate("about:blank")
>>	IF '<TITLE>404 NOT FOUND</TITLE>' $ UPPER(tcHTML) OR '<TITLE>400 BAD REQUEST</TITLE>' $ UPPER(tcHTML)
>>		lcFileType = 'html'
>>	ELSE
>>		lcFileType = 'gif'
>>	ENDIF
>>
>>	lcTempFile = FULLPATH(CURDIR()) + 'Temp\' + SYS(2015) + "Map." + lcFileType
>>	STRTOFILE(tcHTML,lcTempFile)
>>	WaitForReadyState(This.oBrowser)
>>
>>	IF lcFileType = 'html'
>>		This.oBrowser.Navigate(lcTempFile)
>>	ELSE
>>		This.oBrowser.Document.Body.innerHTML = [<img src=] + lcTempFile + [>]
>>	ENDIF
>>	This.oBrowser.Refresh()
>>	*DELETE FILE lcTempFile
>>ENDIF
>>
>>FUNCTION WaitForReadyState
>>LPARAMETERS toBrowser,lnReadyState,lnMilliSeconds
>>	IF EMPTY(lnReadyState)
>>		lnReadyState = 4
>>	ENDIF
>>	IF EMPTY(lnMilliSeconds)
>>		lnMilliSeconds = 4000
>>	ENDIF
>>
>>	DECLARE INTEGER Sleep IN WIN32API INTEGER nMSecs
>>
>>	LOCAL lnX
>>	lnX = 0
>>	DO WHILE toBrowser.ReadyState # lnReadyState AND lnX < lnMilliSeconds
>>		DOEVENTS
>>		lnX = lnX + 1
>>		Sleep(1)
>>	ENDDO
>>
>>	IF lnX < lnMilliSeconds
>>		RETURN .T. && Not timed out
>>	ENDIF
>>	RETURN .F.
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform