Jump to content
Fivewin Brasil

HbOleAut


oliveiros

Recommended Posts

Olá pessoal, boa noite! 

Preciso compilar um programa antigo e estou precisando da lib HbOleAut, queria saber se tem alguém que possa compartilhar. A que tenho é de 15.07.2007. Estou tentando abrir um página da internet, e para isso estou usando a seguinte rotina:

Function AbrirURL()
   Local oOle, cURL
   
   cURL := "https://receita.fazenda.df.gov.br.com.br"
      
   oOle:= TOleAuto():NEW( "InternetExplorer.Application" )

   oOle:Visible    := .T.
   oOle:ToolBar    := .F.
   oOle:StatusBar  := .F.
   oOle:MenuBar    := .F.
 
   oOle:Navigate2( cURL ) 
   
   //While oOle:ReadyState <> 4
   //      SysWait( .5 )
   //Enddo
   
   SysRefresh()
Return .t.
*----------------------------------------------------------------------------------------*

O programa compila, porém diz que a propriedade Navigate2, no momento da execução, é "tipo de variante não implementado"

Desde já agradeço.

Se quiser mandar direto, pode mandar para oliveiros.jr@uol.com.br

Att.,

Oliveiros Junior

 

 

 

Link to comment
Share on other sites

Enquanto eu altero a sua rotina, USE ESTA:

// C:\FWH..\SAMPLES\FBM1994.PRG
	#include "FiveWin.ch"
#include "hbcompat.ch"
	FUNCTION Oliveiros() // GOTOPA()
	   LOCAL cRet
	   MsgRun( "AGUARDE... VERIFICANDO RECEITA FEDERAL DO DF.",                  ;
           "Por Favor, Espere Abertura. Pode Demorar.    ",                  ;
           { || WinExec( PegaSefaz() ), 3 } )
	RETURN NIL
	FUNCTION PegaSefaz()
	   LOCAL OOLE, CDIA, CMES, CANO, CDATA, CHORA
   LOCAL cRet := "", cPagina
   LOCAL cTexto := "Local time in Brasilia"
	   IF ( oOle := Cria_OLE( "InternetExplorer.Application", , .T. ) ) == NIL
	      RETURN( .F. )
	   ENDIF
	   cPagina := "https://receita.fazenda.df.gov.br/"
	   oOle:Visible    := .T.
   oOle:ToolBar    := .F.
   oOle:StatusBar  := .F.
   oOle:MenuBar    := .F.
	   oOle:Navigate( cPagina )
	   WHILE oOle:ReadyState() != 4  // Aguarda página ser carregada, mesmo q não seja visualizado no Navegador (opão Visible := F ou T)
	      SysWait( .5 )
	   ENDDO
	Return( cRet )
	FUNCTION Cria_OLE( cObj_OLE, cMsg, lGetActiveObj )
	   /* Cria objeto Ole */
   LOCAL oObj_OLE := NIL
	   cMsg := 'Erro ao Tentar Carregar Pagina...Tente Novamente'
	   lGetActiveObj := .F.
	   IF lGetActiveObj
	      TRY
	         oObj_OLE := GetActiveObject( cObj_OLE )
	      CATCH
	         TRY
            oObj_OLE := CREATEOBJECT(cObj_OLE)
	         CATCH
	            Alert(cMsg)
	            RETURN oObj_OLE
	         END
	       END
	    ELSE
	       TRY
          oObj_OLE := CREATEOBJECT(cObj_OLE)
	       CATCH
	          Alert( cMsg )
	          RETURN oObj_OLE
	       END
	    ENDIF
	RETURN( oObj_OLE )
	// FIM

Regards, saludos.
 

Link to comment
Share on other sites

Pronto. Veja como é simples:

// C:\FWH..\SAMPLES\OLIVEIRO.PRG
	#include "FiveWin.ch"
#include "hbcompat.ch"
	FUNCTION Main()
	   LOCAL cRet
	   MsgRun( "AGUARDE... VERIFICANDO RECEITA FEDERAL DO DF.",                  ;
           "Por Favor, Espere Abertura. Pode Demorar.    ",                  ;
           { || WinExec( AbrirURL() ), 3 } )
	RETURN NIL
	Function AbrirURL()
	   Local oOle, cURL
	   // cURL := "https://receita.fazenda.df.gov.br.com.br" //ERRADO
   // //https://receita.fazenda.df.gov.br/
   cURL := "https://receita.fazenda.df.gov.br/"
      
   oOle:= TOleAuto():NEW( "InternetExplorer.Application" )
	   oOle:Visible    := .T.
   oOle:ToolBar    := .F.
   oOle:StatusBar  := .F.
   oOle:MenuBar    := .F.
   oOle:FullScreen := .F.
	   oOle:Invoke( "Navigate", cURL )
	   // OU:
   // oOle:Navigate( cURL )
	   // OU:
   // oOle:Navigate2( cURL )
   
   While oOle:ReadyState <> 4
	      SysRefresh()
	      SysWait( .5 )
	   Enddo
	RETURN( .T. )
	// FIN / END

Regards, saludos.

Edited by kapiaba
Link to comment
Share on other sites

ZIP esse fivewin, o Harbour/xHarbour e o BCC dessa versão, hospede no:

	https://mega.nz/
	

E me envie os links para download que eu baixo e testo aqui. E você pode usar a Versão 6.12 do Fivewin que é grátis para compilar no lugar dessa "relíquia" ai. 

Regards, saludos.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...