Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Readystate and member does not evaluate to an object
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00963939
Message ID:
00963972
Vues:
22
Hi Zakaria,

Try this...
cUrl = "https://securesitefiction.nl"

THISFORM.oWebBrowser.Navigate(cUrl)

llAuto=WaitToIE_Busy(THISFORM.oWebBrowser)
IF llAuto
   llAuto=WaitToIE_RS(THISFORM.oWebBrowser)
ENDIF

...
IF llAuto
   dc =THISFORM.oWebBrowser.document
   dc.Forms(0).item("Inloggen").Click()

   llAuto=WaitToIE_Busy(THISFORM.oWebBrowser)
   IF llAuto
      llAuto=WaitToIE_RS(THISFORM.oWebBrowser)
   ENDIF
ENDIF
...

***************************************************
PROCEDURE WaitToIE_Busy(loIE)
* loIE - Objekt IE
LOCAL liCount,liMax
liMax=600
liCount=0

DO WHILE TYPE("loIE")="O" AND !ISNULL(loIE) AND loIE.Busy AND liCount<liMax
   =Sleep(250)
   liCount=liCount+1
ENDDO
RETURN liCount<liMax AND TYPE("loIE")="O" AND !ISNULL(loIE)

***************************************************
PROCEDURE WaitToIE_RS(loIE)
* loIE - Objekt IE
LOCAL liCount,liMax
liMax=600
liCount=0
DO WHILE TYPE("loIE")="O" AND !ISNULL(loIE) AND loIE.ReadyState<=3 AND liCount<liMax
   =Sleep(250)
   liCount=liCount+1
ENDDO
RETURN liCount<liMax AND TYPE("loIE")="O" AND !ISNULL(loIE)
>Hello,
>
>I'm using a webbrowser Activex control to do some tasks : navigate to a website, fill a form and login. After this I want the webbrowser to click a hyperlink, but the problem is that the code generates an error: "Member does not evaluate to an object". Very strange because the document.readystate after the login is equal to "complete" and the owebbrowser.readystate is equal 4. So the rendering of the document is complete, I don't understand the error. I have the following code, could someone help? Thank you
>
>
>
>cGebruikersnaam = "abracadabra"
>cPassword = "hocuspocus"
>cUrl = "https://securesitefiction.nl"
>
>THISFORM.oWebBrowser.Navigate(cUrl)
>dc =THISFORM.oWebBrowser.document
>
>DO WHILE dc.readystate <> "complete"
>
>ENDDO 	
>
>
>**** INVULLEN EN INLOGGEN
>dc.Forms(0).item("strUserID").Value = cGebruikersnaam
>dc.Forms(0).item("strPassword").Value = cPassword
>dc.Forms(0).item("Inloggen").Click()
>
>
>***Login
>DO WHILE (dc.readystate <> "complete")
>
>ENDDO 	
>
>
>
>MESSAGEBOX(dc.readystate) && gives "complete"
>MESSAGEBOX(thisform.owebbrowser.readystate) && gives 4
>
>
>
>dc.links(1).click() && error member "links" does not evaluate to an object
>
>*just testing:
>loLinks = dc.getElementsByTagName("A")
>MESSAGEBOX(lolinks.length)
>
>FOR EACH lnk IN lolinks
> MESSAGEBOX(lnk.innerhtml)	
> IF LOWER(lnk.innerhtml) = "overschrijven"
>    lnk.click()
> ENDIF
>ENDFOR
>
>
>
>Zakaria al Azhar
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform