Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Refreshhing Browser Control in a code
Message
 
 
À
12/03/2004 00:01:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00885475
Message ID:
00886012
Vues:
19
Hi Michel,

Can you explain what problem exactly do you have when you load the same file second time?

>When browser control placed onto form visually and this form runs, issuing navigate method even for the same local file ( assuming it was refreshed with the new content ) refreshes browser control without any problem. However, in a code below removing and adding subclassed browser control is required , otherwise we are in a loop for readystate. I am aware of CreateObject( "internetexplorer.application" ) which works properly with navigate method without need to instantiate it each time, but I need an alternative way for someone. My main concern is that the method below is very slow.
>
>Thanks
>Michael
>
>
>oparser = CREATEOBJECT('HTMLParser' )
>SCAN
>    ltext = oparser.getInnerText(htmlfield )
>ENDSCAN
>
>
>DEFINE CLASS HTMLParser AS FORM
>
>    FUNCTION getInnerText
>    LPARAMETERS tcHTML
>    ltext = ''
>    TRY
>        lcTemp =  ADDBS(SYS(5)+CURDIR())+ SYS(2015)+ '.htm'
>        STRTOFILE(tcHTML,lcTemp ,0)
>
>* required to avoid to achieve readystate
>
>        IF VARTYPE(THIS.oie) = 'O'
>            THIS.REMOVEOBJECT( "oIE" )
>        ENDIF
>        THIS.ADDOBJECT( "oIE" , "fbrowser" )
>***
>        WITH THIS.oie
>            .Navigate2(lcTemp)
>            DO WHILE .ReadyState # 4
>                WAIT WINDOW "" TIMEOUT .01
>            ENDDO
>        ENDWITH
>        ltext =  THIS.oie.DOCUMENT.body.innertext
>    CATCH  TO loexception
>        ltext = ''
>    ENDTRY
>    RETURN ltext
>    ENDFUNC
>ENDDEFINE
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform