Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Difficulty with browser control
Message
From
03/10/2008 11:34:45
 
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:
01352586
Views:
20
Sorry to bother again, but the compiled version still has the same problem. I did a full recompile.

A new problem: the project.fpt dissappears. What the heck is going on? I'll report later on.

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
Reply
Map
View

Click here to load this message in the networking platform