Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WebControl refresh issues
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
01315383
Message ID:
01315649
Views:
24
Sergey, thanks for your help. I found your message #985841 from 2005. From your example, the adding of a readystate check after about:blank AND after document.write corrected the refresh issue, the image issue was pathing related.
IF FILE("&lcFile")
   lcHTML = FILETOSTR(lcFile)
   lcHTML = STRTRAN(lcHTML,"FCIS","<FONT COLOR='BLUE'><B>FCIS</B></FONT>",1,20)
   lcHTML = "<html><body>"+lcHtml+"</body></html>"
	
   WITH thisform.overview.OleComments
     .Navigate("about:blank")
     lnStartSeconds = SECONDS()
     DO WHILE .ReadyState <> 4 ;
        AND (SECONDS()-lnStartSeconds <= 10 )
        DOEVENTS
     ENDDO			
     .Document.Open()
     .Document.Write(lcHtml)	
     .Document.Close()		

     lnStartSeconds = SECONDS()
     DO WHILE .ReadyState <> 4 ;
        AND (SECONDS()-lnStartSeconds <= 1 )
        DOEVENTS
     ENDDO	
   ENDWITH
ENDIF
Had to include pathing to view the image, which presents another issue with distribution...
<IMG SRC="file:///C:/blah/blah/auto_asset.jpg">
>
>>Good point. I dont have [HTML] and [BODY] tags in these files. Will give that a shot.
>>
>>>You may have better luck with loading HTML from files.
>>>
>>>>I am replacing a FLASH routine thats used as an intro to an installer process with a VFP intro version. Comments are displayed to the user at different steps along the process. These comments are stored in TXT files that i read into a string and then assign to the webcontrol for display via the "Document.Write" command on a foxpro form.
>>>>
>>>>lcFile = "overview" + ALLTRIM(STR(thisform.zPageIntro - 1))+".txt"
>>>>IF FILE("&lcFile")
>>>>   lcHTML = FILETOSTR(lcFile)
>>>>   lcHTML = STRTRAN(lcHTML,"FCIS","<FONT COLOR='BLUE'><B>FCIS</B></FONT>",1,20)
>>>>   WITH thisform.overview.oleWebControl
>>>>     .Navigate("about:blank")
>>>>     .Document.Open()
>>>>     .Document.Write(lcHtml)
>>>>     .Document.Close()
>>>>     .refresh()
>>>>   ENDWITH
>>>>   thisform.overview.Refresh()
>>>>ENDIF
>>>>
>>>>The problem is that the refreshing of the text in the WebControl from the different text files is terrible. Sometimes it works, sometimes not. A page's text will show going forward, but going backward it wont. Very random.
>>>>
>>>>I also have a reference to a JPG imbedded in the TXT file that wont show on the WebControl. I get the broken image symbol, but the jpg is located in the same folder. Is "FILE" syntax required here?
>>>>
>>>><img src="auto_asset.jpg" width="280" height="230">
Previous
Reply
Map
View

Click here to load this message in the networking platform