Saludos estimados
Tengo un problema al invocar a IE, unas veces funciona y en otras no, alguien me puede sugerir una alternativa, estoy invocando una APP WEB que hace un proceso y devuelve un resultado, actualmente lo hago asi:
clicksing:="www.appweb.com"
TRY
oIE:=CreateObject("InternetExplorer.Application") // Primer intento
CATCH
MsgWait("Error al crear el componente InternetExplorer.Application 1","Error al firmar, reintentando",2) // AQUI tengo el problema, a veces sale, a veces NO
retu .f.
END
WITH OBJECT oIE
:Visible := .F.
:ToolBar := .F.
:FullScreen := .F.
:Invoke( "Navigate", cURL )
END WITH
TRY
oIE:Navigate2( clinkSing )
CATCH oErr1
TRY
oIE:Navigate( clinkSing )
CATCH oErr2
MsgWait("Error al tratar de firmar documento","No firmo",2)
retu .f.
END
END
HB_IDLESLEEP( 1 )
nPos:=0
WHILE oIE:ReadyState <> 4 .AND. nPos<20
HB_IDLESLEEP( 1 )
nPos++
END
IF nPos>=20
MsgStop("Tiempo de espera superado")
RETURN NIL
ENDIF
oIe:Visible:=.F.
cTextoHTML:=oIE:Document:body:innerHTML()
cRpta:=subs(cTextoHTML,AT("{respuest:",cTextoHTML)+10,1 )
if cRpta=="1"
MsgStop("No existe el archivo que se quiere procesar : "+cValFil,gci_msgerror())
else
MsgWait("Se proceso correctamente el archivo",gci_msgalert(),3)
end if
oIE:quit()
retu .t.
Error al crear el objeto InternetExplorer.Application
-
- Posts: 556
- Joined: Fri Oct 07, 2005 2:17 pm
- Location: Lima - Peru
- Been thanked: 3 times
- Contact:
Error al crear el objeto InternetExplorer.Application
Enrrique Vertiz Pitta
Lima-Peru
xHb 1.23.1026X, Fwh 24.09, BCC74, MySQL 8.0.X, SQLLIB 1.9m
Lima-Peru
xHb 1.23.1026X, Fwh 24.09, BCC74, MySQL 8.0.X, SQLLIB 1.9m
- Antonio Linares
- Site Admin
- Posts: 42584
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 38 times
- Been thanked: 86 times
- Contact:
Re: Error al crear el objeto InternetExplorer.Application
Enrique,
Prueba a llamar a SysRefresh() en vez de llamar a HB_IDLESLEEP()
Prueba a llamar a SysRefresh() en vez de llamar a HB_IDLESLEEP()
- karinha
- Posts: 7948
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: Error al crear el objeto InternetExplorer.Application
Complete, porfa:
Error: Unresolved external '_HB_FUN_GCI_MSGERROR' referenced from
Error: Unresolved external '_HB_FUN_GCI_MSGALERT' referenced from
Regards, saludos.
Error: Unresolved external '_HB_FUN_GCI_MSGERROR' referenced from
Error: Unresolved external '_HB_FUN_GCI_MSGALERT' referenced from
Code: Select all | Expand
// \SAMPLES\VERTIZ3.PRG
#Include "FiveWin.ch"
FUNCTION Main()
LOCAL cLinkSing, oIE, nPos, cTextoHTML, cRpta, CURL, OERR1, OERR2, CVALFIL
cLinkSing := ( "www.appweb.com" )
CURL := cLinkSing // es esto?
TRY
oIE := CreateObject( "InternetExplorer.Application" ) // Primer intento
CATCH
MsgWait( "Error al crear el componente Internet", ;
"Error al firmar, reintentando ", 2 ) // AQUI tengo el problema, a veces sale, a veces NO
RETURN( .F. )
END
WITH OBJECT oIE
:Visible := .F.
:ToolBar := .F.
:FullScreen := .F.
:Invoke( "Navigate", cURL ) //??? donde esta?
END WITH
TRY
oIE:Navigate2( cLinkSing ) // el correcto es asi
CATCH oErr1
TRY
oIE:Navigate( cLinkSing )
CATCH oErr2
MsgWait("Error al tratar de firmar documento","No firmo",2)
RETURN( .F. )
END
END
// HB_IDLESLEEP( 1 ) // ?? Motivo??
nPos := 0
WHILE oIE:ReadyState <> 4 .AND. nPos<20
// HB_IDLESLEEP( 1 ) //??? Motivo de usar este comando?
SYSREFRESH()
SysWait( 0.1 )
nPos++
ENDDO
IF nPos>=20
MsgStop("Tiempo de espera superado")
RETURN NIL
ENDIF
oIe:Visible:=.F.
cTextoHTML := oIE:Document:body:innerHTML()
cRpta := SUBST( cTextoHTML, AT( "{respuest:", cTextoHTML ) +10, 1 )
IF cRpta=="1"
MsgStop("No existe el archivo que se quiere procesar : "+cValFil, gci_msgerror())
ELSE
MsgWait("Se proceso correctamente el archivo",gci_msgalert(),3)
ENDIF
oIE:Quit()
RETURN( .T. )
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
-
- Posts: 556
- Joined: Fri Oct 07, 2005 2:17 pm
- Location: Lima - Peru
- Been thanked: 3 times
- Contact:
Re: Error al crear el objeto InternetExplorer.Application
Gracias Antonio / Karinha
Probando
Probando
Enrrique Vertiz Pitta
Lima-Peru
xHb 1.23.1026X, Fwh 24.09, BCC74, MySQL 8.0.X, SQLLIB 1.9m
Lima-Peru
xHb 1.23.1026X, Fwh 24.09, BCC74, MySQL 8.0.X, SQLLIB 1.9m