Page 5 of 11
Re: xHarbour.org updated!
Posted: Tue Sep 19, 2023 8:19 pm
by karinha
Intente ahoha:
http://fivewin.com.br/index.php?/topic/ ... 3%BAblico/
Code: Select all | Expand
// C:\FWH..\SAMPLES\WARTIAG4.PRG
#include "Fivewin.ch"
#include "tip.ch" // ARISTON.PRG
FUNCTION Main()
LOCAL oDlg, oGet
LOCAL cCad := "Testing " // pad("Testing Gets",40)
LOCAL nNum := 0
LOCAL dDat := Date()
inicio := 0
SET CENTURY ON
SET DATE TO BRITISH
SET EPOCH TO 1960
SET Multiple ON
SET DELETED ON
DEFINE DIALOG oDlg TITLE "TGet from " + FWDESCRIPTION
@ 1, 2 SAY "Text..:" OF oDlg
@ 1, 6 GET oGet1 VAR Inicio OF oDlg SIZE 100, 10 COLOR "W/G" PICTURE "99999999"
@ 3, 7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION Averba()
@ 3, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
STATIC FUNCTION Averba()
LOCAL oUrl, oCli, url
LOCAL hQUery := Hash()
url := "https://apis.averbeporto.com.br/php/conn.php"
TRY
// oUrl = TUrl():New( 'https://apis.averbeporto.com.br/php/conn.php' )
oUrl := TUrl():New( url ) // From tip.lib
oCli := TipClientHttp():New( oUrl, .f. ) // From tip.lib
// oCli = TIPClientHttp():New( oUrl )
CATCH
MsgInfo('Conection Error','Erro')
RETURN NIL
END
IF .NOT. Empty( oUrl )
// oCli = TIPClientHttp():New( oUrl )
IF .NOT. Empty( oCli )
oCli:nConnTimeout = -1
oCli:lSSL = .T.
IF oCli:Open()
hQuery[ "mod" ] := "login"
hQuery[ "comp" ] := "5"
hQuery[ "user" ] := "xxxxxxxxxxxx"
hQuery[ "pass" ] := "xxxxxxxxxxxx"
oCli:cUserAgent := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)'
IF !oCli:PostMultiPart( hQuery )
CurSorArrow()
MsgInfo( oCli:lastErrorMessage, 'Error' )
ELSE
cNFSeResp := oCli:ReadAll()
RespC := oCli:GetCookies() // Get cookie
ENDIF
oCli:Close()
ENDIF
ENDIF
ENDIF
msginfo( cNFSeResp )
msginfo( RespC )
RETURN NIL
//--------------------------------------------------------------------------//
DLL Function DeleteUrlCacheEntry(lpszUrlName AS STRING) AS LONG PASCAL FROM "DeleteUrlCacheEntryA" LIB "wininet.dll"
//--------------------------------------------------------------------------//
/* // teste
#include "FiveWin.ch"
#include "tip.ch"
FUNCTION RetPublicIP()
LOCAL cPubIP := "", cxHtml := "", url, oUrl, oHttp, oErr
url := "http://checkip.dyndns.org"
try
oUrl:=TUrl():New( url ) // From tip.lib
oHttp := TipClientHttp():New( oUrl , .f. ) // From tip.lib
catch oErr
? "Erro: "+oErr:Description
end try
Try
oHttp:Open()
cxHtml := oHttp:ReadAll() // Baixa todo o conteúdo do site.
cPubIP := allTrim( substr( substr( cxHtml, rat( "<body>", cxHtml ) + 26 ), 1, At( "<", substr( cxHtml, rat( "<body>", cxHtml ) + 26 ) ) - 1 ) )
catch oErr
? "Erro: "+oErr:Description
End
oHttp:Close()
DeleteUrlCacheEntry(url) // Lipar Cache
? cPubIP
Return Nil
//----------------------------------------------------------------------------------------------------------------------//
DLL Function DeleteUrlCacheEntry(lpszUrlName AS STRING) AS LONG PASCAL FROM "DeleteUrlCacheEntryA" LIB "wininet.dll"
//----------------------------------------------------------------------------------------------------------------------//
*/
Regards, saludos.
Re: xHarbour.org updated!
Posted: Wed Sep 20, 2023 12:59 am
by wartiaga
karinha wrote:Intente ahoha:
http://fivewin.com.br/index.php?/topic/ ... 3%BAblico/
Code: Select all | Expand
// C:\FWH..\SAMPLES\WARTIAG4.PRG
#include "Fivewin.ch"
#include "tip.ch" // ARISTON.PRG
FUNCTION Main()
LOCAL oDlg, oGet
LOCAL cCad := "Testing " // pad("Testing Gets",40)
LOCAL nNum := 0
LOCAL dDat := Date()
inicio := 0
SET CENTURY ON
SET DATE TO BRITISH
SET EPOCH TO 1960
SET Multiple ON
SET DELETED ON
DEFINE DIALOG oDlg TITLE "TGet from " + FWDESCRIPTION
@ 1, 2 SAY "Text..:" OF oDlg
@ 1, 6 GET oGet1 VAR Inicio OF oDlg SIZE 100, 10 COLOR "W/G" PICTURE "99999999"
@ 3, 7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION Averba()
@ 3, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
STATIC FUNCTION Averba()
LOCAL oUrl, oCli, url
LOCAL hQUery := Hash()
url := "https://apis.averbeporto.com.br/php/conn.php"
TRY
// oUrl = TUrl():New( 'https://apis.averbeporto.com.br/php/conn.php' )
oUrl := TUrl():New( url ) // From tip.lib
oCli := TipClientHttp():New( oUrl, .f. ) // From tip.lib
// oCli = TIPClientHttp():New( oUrl )
CATCH
MsgInfo('Conection Error','Erro')
RETURN NIL
END
IF .NOT. Empty( oUrl )
// oCli = TIPClientHttp():New( oUrl )
IF .NOT. Empty( oCli )
oCli:nConnTimeout = -1
oCli:lSSL = .T.
IF oCli:Open()
hQuery[ "mod" ] := "login"
hQuery[ "comp" ] := "5"
hQuery[ "user" ] := "xxxxxxxxxxxx"
hQuery[ "pass" ] := "xxxxxxxxxxxx"
oCli:cUserAgent := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)'
IF !oCli:PostMultiPart( hQuery )
CurSorArrow()
MsgInfo( oCli:lastErrorMessage, 'Error' )
ELSE
cNFSeResp := oCli:ReadAll()
RespC := oCli:GetCookies() // Get cookie
ENDIF
oCli:Close()
ENDIF
ENDIF
ENDIF
msginfo( cNFSeResp )
msginfo( RespC )
RETURN NIL
//--------------------------------------------------------------------------//
DLL Function DeleteUrlCacheEntry(lpszUrlName AS STRING) AS LONG PASCAL FROM "DeleteUrlCacheEntryA" LIB "wininet.dll"
//--------------------------------------------------------------------------//
/* // teste
#include "FiveWin.ch"
#include "tip.ch"
FUNCTION RetPublicIP()
LOCAL cPubIP := "", cxHtml := "", url, oUrl, oHttp, oErr
url := "http://checkip.dyndns.org"
try
oUrl:=TUrl():New( url ) // From tip.lib
oHttp := TipClientHttp():New( oUrl , .f. ) // From tip.lib
catch oErr
? "Erro: "+oErr:Description
end try
Try
oHttp:Open()
cxHtml := oHttp:ReadAll() // Baixa todo o conteúdo do site.
cPubIP := allTrim( substr( substr( cxHtml, rat( "<body>", cxHtml ) + 26 ), 1, At( "<", substr( cxHtml, rat( "<body>", cxHtml ) + 26 ) ) - 1 ) )
catch oErr
? "Erro: "+oErr:Description
End
oHttp:Close()
DeleteUrlCacheEntry(url) // Lipar Cache
? cPubIP
Return Nil
//----------------------------------------------------------------------------------------------------------------------//
DLL Function DeleteUrlCacheEntry(lpszUrlName AS STRING) AS LONG PASCAL FROM "DeleteUrlCacheEntryA" LIB "wininet.dll"
//----------------------------------------------------------------------------------------------------------------------//
*/
Regards, saludos.
Thanks Karinha, but the line IF oCli:Open() returns .F.
Works with you?
Re: xHarbour.org updated!
Posted: Wed Sep 20, 2023 12:38 pm
by karinha
Usando HTTP, funciona. Usando HTTPS, Error: Operation Not Supported. Que classe controla tipclienthttp()?
Mismo usando TIPSSL.LIB no funciona con ninguna URL que tenga HTTPS. Inclui SEVENZIP.LIB tampoco funciona.
Regards, saludos.
Re: xHarbour.org updated!
Posted: Wed Sep 20, 2023 1:10 pm
by karinha
Intente con ACTIVEX:
Code: Select all | Expand
#include "FiveWin.ch"
STATIC oActiveX
FUNCTION Main( cChave )
LOCAL oFont, oDlgCaptcha, oGet, oGet1, cCaptcha := Space(8), oSefaz, oImage
LOCAL oFnt, oSaida, oBaixarXML
LOCAL oChildWnd, cSite
Default cChave := Space(44)
MsgWait( "CONECTANDO AO PORTAL DA PORTO SEGURO...", ;
"AGUARDE UM MOMENTO POR FAVOR... ", 2.0 )
cChave := "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
cSite := "https://apis.averbeporto.com.br/php/conn.php" // + Login + Senha(cChave)
DEFINE WINDOW oChildWnd FROM 0,0 TO 600,800 PIXEL TITLE "PORTO SEGUROS"
oActiveX = TActiveX():New( oChildWnd, "Shell.Explorer.2" )
oActivex:Silent := .T.
oChildWnd:oClient = oActiveX
oActiveX:Do( "Navigate2", cSite )
ACTIVATE WINDOW oChildWnd
RETURN NIL
// FIN / END
Regards, saludos.
Re: xHarbour.org updated!
Posted: Wed Sep 20, 2023 1:11 pm
by karinha
Intente con ACTIVEX:
#include "FiveWin.ch"
STATIC oActiveX
FUNCTION Main( cChave )
LOCAL oFont, oDlgCaptcha, oGet, oGet1, cCaptcha := Space(8), oSefaz, oImage
LOCAL oFnt, oSaida, oBaixarXML
LOCAL oChildWnd, cSite
Default cChave := Space(44)
MsgWait( "CONECTANDO AO PORTAL DA PORTO SEGURO...", ;
"AGUARDE UM MOMENTO POR FAVOR... ", 2.0 )
cChave := "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
cSite := "https://apis.averbeporto.com.br/php/conn.php" // + Login + Senha(cChave)
DEFINE WINDOW oChildWnd FROM 0,0 TO 600,800 PIXEL TITLE "PORTO SEGUROS"
oActiveX = TActiveX():New( oChildWnd, "Shell.Explorer.2" )
oActivex:Silent := .T.
oChildWnd:oClient = oActiveX
oActiveX:Do( "Navigate2", cSite )
ACTIVATE WINDOW oChildWnd
RETURN NIL
// FIN / END
Regards, saludos.
Re: xHarbour.org updated!
Posted: Wed Sep 20, 2023 1:36 pm
by Enrico Maria Giordano
This is working fine, so it looks like there is something wrong in your server:
Code: Select all | Expand
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oUrl, oCli
// oUrl = TUrl():New( "https://apis.averbeporto.com.br/php/conn.php" )
oUrl = TUrl():New( "https://www.emagsoftware.it" )
? oUrl
oCli = TIPClientHttp():New( oUrl )
? oCli
? oCli:Open()
RETURN NIL
Re: xHarbour.org updated!
Posted: Wed Sep 20, 2023 1:51 pm
by karinha
Enrico,
Code: Select all | Expand
Application
===========
Path and name: c:\FWH1905\samples\ENRICO01.exe (32 bits)
Size: 3,479,552 bytes
Compiler version: xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914)
FiveWin version: FWH 19.05
C compiler version: Borland/Embarcadero C++ 7.6 (32-bit)
Windows version: 6.1, Build 7601 Service Pack 1
Time from start: 0 hours 0 mins 3 secs
Error occurred at: 09/20/23, 10:48:55
Error description: Error BASE/1081 Operation not supported: TIPCLIENTHTTP:New()
Args:
[ 1] = O TIPCLIENTHTTP
[ 2] = C https
Stack Calls
===========
Called from: source\tip\client.prg => TIPCLIENT:NEW( 0 )
Called from: source\tip\httpcln.prg => TIPCLIENTHTTP:NEW( 0 )
Called from: ENRICO01.prg => MAIN( 14 )
Regards, saludos.
Re: xHarbour.org updated!
Posted: Wed Sep 20, 2023 2:04 pm
by Enrico Maria Giordano
You are still using tip.lib. You have to use tipssl.lib instead.
Re: xHarbour.org updated!
Posted: Wed Sep 20, 2023 3:03 pm
by karinha
Enrico, if I remove TIP.LIB:
Code: Select all | Expand
Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023 Embarcadero Technologies, Inc.
ENRICO01.c:
Turbo Incremental Link 6.98 Copyright (c) 1997-2023 Embarcadero Technologies, Inc.
Error: Unresolved external '_HB_FUN_TURL' referenced from C:\FWH1905\SAMPLES\ENRICO01.OBJ
Error: Unresolved external '_HB_FUN_HB_BASE64' referenced from C:\XHBBCC76\LIB\TIPSSL.LIB|client1
Error: Unresolved external '_HB_FUN_TIPENCODERURL_ENCODE' referenced from C:\XHBBCC76\LIB\TIPSSL.LIB|httpcln1
Error: Unresolved external '_HB_FUN_TIPENCODERBASE64' referenced from C:\XHBBCC76\LIB\TIPSSL.LIB|httpcln1
Error: Unable to perform link
* Linking errors *
Is it possible for you to send me yours. LIBs for me to test? There is something wrong with my LIBs.
¿Es posible que me envíes el tuyo? ¿LIB para probar? Hay algún problema con mis LIB.
Where do I download the correct .DLLs to compile with BCC76?
¿Dónde descargo los archivos .DLL correctos para compilar con BCC76?
Regards, saludos.
Re: xHarbour.org updated!
Posted: Wed Sep 20, 2023 3:16 pm
by Enrico Maria Giordano
karinha wrote:Is it possible for you to send me yours. LIBs for me to test?
Of course. These are the SSL libs:
https://wormhole.app/AEpe5#v4kFOa7EMouYDQ8MvifgEQ
And these are the SSL dlls:
https://wormhole.app/31eO1#Fuwohtx2zBTUjY3YpLz8RA
Do you need something else?
Re: xHarbour.org updated!
Posted: Wed Sep 20, 2023 3:55 pm
by karinha
Enrico, Did not work. Are these LIBS correct?
Enrique, no funcionó. ¿Son correctas estas LIBS?
Code: Select all | Expand
Pasta de c:\XHBBCC76\lib
25/07/2020 11:28 608.768 libcrypto.lib
25/07/2020 11:28 74.752 libssl.lib
15/09/2023 16:02 115.200 tipssl.lib
Gracias, thanks.
Reards, saludos.
Re: xHarbour.org updated!
Posted: Wed Sep 20, 2023 4:16 pm
by Enrico Maria Giordano
karinha wrote:Enrico, Did not work. Are these LIBS correct?
Enrique, no funcionó. ¿Son correctas estas LIBS?
Code: Select all | Expand
Pasta de c:\XHBBCC76\lib
25/07/2020 11:28 608.768 libcrypto.lib
25/07/2020 11:28 74.752 libssl.lib
15/09/2023 16:02 115.200 tipssl.lib
Gracias, thanks.
Reards, saludos.
Yes, they are correct. Can I see your compile batch and the list of the libs you are linking?
Re: xHarbour.org updated!
Posted: Wed Sep 20, 2023 4:18 pm
by Enrico Maria Giordano
karinha wrote:Enrico, if I remove TIP.LIB:
Code: Select all | Expand
Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023 Embarcadero Technologies, Inc.
ENRICO01.c:
Turbo Incremental Link 6.98 Copyright (c) 1997-2023 Embarcadero Technologies, Inc.
Error: Unresolved external '_HB_FUN_TURL' referenced from C:\FWH1905\SAMPLES\ENRICO01.OBJ
Error: Unresolved external '_HB_FUN_HB_BASE64' referenced from C:\XHBBCC76\LIB\TIPSSL.LIB|client1
Error: Unresolved external '_HB_FUN_TIPENCODERURL_ENCODE' referenced from C:\XHBBCC76\LIB\TIPSSL.LIB|httpcln1
Error: Unresolved external '_HB_FUN_TIPENCODERBASE64' referenced from C:\XHBBCC76\LIB\TIPSSL.LIB|httpcln1
Error: Unable to perform link
* Linking errors *
Are you sure you have put tip.lib
AFTER tipsll.lib, libssl.lib and libcrypto.lib?
Re: xHarbour.org updated!
Posted: Wed Sep 20, 2023 4:55 pm
by karinha
Are you sure you have put tip.lib AFTER tipsll.lib, libssl.lib and libcrypto.lib?
Enrico, asi?
Code: Select all | Expand
echo %hdirl%\libcrypto.lib + >> b32.bc
echo %hdirl%\libssl.lib + >> b32.bc
echo %hdirl%\tipssl.lib + >> b32.bc
echo %hdirl%\tip.lib + >> b32.bc
Regards, saludos.
Re: xHarbour.org updated!
Posted: Wed Sep 20, 2023 5:09 pm
by karinha
Ahora funcionó de pronto! Gracias Enrico! Many thanks!!
Code: Select all | Expand
// C:\FWH..\SAMPLES\WARTIAG4.PRG
#include "Fivewin.ch"
#include "tip.ch" // ARISTON.PRG
FUNCTION Main()
LOCAL oDlg, oGet, oGet1
LOCAL cCad := "Testing " // pad("Testing Gets",40)
LOCAL nNum := 0
LOCAL dDat := Date()
LOCAL inicio
inicio := 0
SET CENTURY ON
SET DATE TO BRITISH
SET EPOCH TO 1960
SET Multiple ON
SET DELETED ON
DEFINE DIALOG oDlg TITLE "TGet from " + FWDESCRIPTION
@ 1, 2 SAY "Text..:" OF oDlg
@ 1, 6 GET oGet1 VAR Inicio OF oDlg SIZE 100, 10 COLOR "W/G" PICTURE "99999999"
@ 3, 7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION Averba()
@ 3, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
STATIC FUNCTION Averba()
LOCAL oUrl, oCli, url, cNFSeResp, RespC
LOCAL hQUery := Hash()
url := "https://apis.averbeporto.com.br/php/conn.php"
TRY
// oUrl = TUrl():New( 'https://apis.averbeporto.com.br/php/conn.php' )
oUrl := TUrl():New( url ) // From tip.lib
oCli := TipClientHttp():New( oUrl, .f. ) // From tip.lib
// oCli = TIPClientHttp():New( oUrl )
CATCH
MsgInfo('Conection Error','Erro')
RETURN NIL
END
IF .NOT. Empty( oUrl )
// oCli = TIPClientHttp():New( oUrl )
IF .NOT. Empty( oCli )
oCli:nConnTimeout = -1
oCli:lSSL = .T.
IF oCli:Open()
hQuery[ "mod" ] := "login"
hQuery[ "comp" ] := "5"
hQuery[ "user" ] := "xxxxxxxxxxxx"
hQuery[ "pass" ] := "xxxxxxxxxxxx"
oCli:cUserAgent := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)'
IF !oCli:PostMultiPart( hQuery )
CurSorArrow()
MsgInfo( oCli:lastErrorMessage, 'Error' )
ELSE
cNFSeResp := oCli:ReadAll()
RespC := oCli:GetCookies() // Get cookie
ENDIF
oCli:Close()
ENDIF
ENDIF
ENDIF
msginfo( cNFSeResp )
msginfo( RespC )
RETURN NIL
DLL Function DeleteUrlCacheEntry(lpszUrlName AS STRING) AS LONG PASCAL FROM "DeleteUrlCacheEntryA" LIB "wininet.dll"
Regards, saludos.