//Para tratamiento CURL
#include "C:\harbour64_MVSC_2022\contrib\hbcurl\hbcurl.ch"
...
function main()
...
MENUITEM '&CURL_FTP' ACTION ftpSubirFichero( "ftp://direccion.mooo.org/fichdescargado.txt",;
"C:\carpeta2\prueba.txt", "usuario", "password" )
...
function ftpSubirFichero( cUrlFileName, cFileName, aUser, aPass )
local hCurl
local nResult
local aaUser := AllTrim(aUser)
local aaPass := AllTrim(aPass)
local aCadena := aaUser+":"+aaPass
curl_global_init()
if ! empty( hCurl := curl_easy_init() )
curl_easy_setopt( hCurl, HB_CURLOPT_PROTOCOLS, HB_CURLPROTO_FTP) //HB_CURLPROTO_SFTP)
curl_easy_setopt( hCurl, HB_CURLOPT_URL, cUrlFileName )
curl_easy_setopt( hCurl, HB_CURLOPT_DL_BUFF_SETUP )
curl_easy_setopt( hCurl, HB_CURLOPT_UPLOAD )
curl_easy_setopt( hCurl, HB_CURLOPT_UL_FILE_SETUP, cFileName )
curl_easy_setopt( hCurl, HB_CURLOPT_INFILESIZE, hb_vfSize( cFileName ) )
curl_easy_setopt( hCurl, HB_CURLOPT_USERPWD, aCadena )
curl_easy_setopt( hCurl, HB_CURLOPT_TCP_KEEPALIVE, 1 )
curl_easy_setopt( hCurl, HB_CURLOPT_SSL_VERIFYHOST, 0 )
curl_easy_setopt( hCurl, HB_CURLOPT_SSL_VERIFYPEER, 0 )
curl_easy_setopt( hCurl, HB_CURLOPT_VERBOSE, 1 )
curl_easy_setopt( hCurl, HB_CURLOPT_USE_SSL, 0 )
if ( nResult := curl_easy_perform( hCurl ) ) == 0
nResult := curl_easy_dl_buff_get( hCurl )
else
? "error code:" + Str( nResult )
endif
endif
curl_global_cleanup()
return nResult
@ECHO OFF
CLS
ECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
ECHO ?FWH 64 for Harbour 21.04 (VS64bits) Apr. 2021 Harbour development power ³Ü
ECHO ?(c) FiveTech 1993-2021 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 ³Û
ECHO ? Modificación Verhoven 25/06/2021 ³Û
ECHO ? MS Visual Studio Community 2022 para 64 Bits (29/06/2022) ³Û
ECHO ? ³Û
ECHO ? Carpetas de la instalación para que funcione este bat: ³Û
ECHO ? FWH 64: C:\FWH64 ³Û
ECHO ? Harbour 64: C:\harbour64_MVSC_2022 ³Û
ECHO ? VSC 2022: En la que instala por defecto ³Û
ECHO ? ³Û
ECHO ? MULTIHILOS ³Û
ECHO ? ³Û
ECHO ? Para generar el exe: ³Û
ECHO ? build64 MIPROG.PRG genera MIPROG_64.EXE ³Û
ECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
ECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST
@set oldpath=%path%
@set oldinclude=%include%
@set oldlib=%lib%
@set oldlibpath=%libpath%
@set current_dir=%cd%
@set path=%path%;C:\harbour64_MVSC_2022\lib\win\msvc64;C:\harbour64_MVSC_2022\include
if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
if "%FWDIR%" == "" set FWDIR=C:\fwh64
if "%HBDIR%" == "" set HBDIR=C:\harbour64_MVSC_2022
ECHO ***** Compiling with Harbour 64 bytes...
set hdir=%HBDIR%
set hdirl=%HBDIR%\lib\win\msvc64
@cd %current_dir%
%hdir%\bin\win\msvc64\harbour %1 /n /i%FWDIR%\include;%hdir%\include /p /d__64__ %2 %3 > comp.log 2> warnings.log
IF ERRORLEVEL 1 GOTO COMPILEERROR
@type comp.log
@type warnings.log
ECHO .
ECHO ***** Compiling with MSVC 2022 64 bytes...
cl -D__64__ -TP -W3 -O2 -c -I%hdir%\include -I"%ProgramFiles(x86)%\Windows Kits"\10\Include\10.0.22621.0\ucrt %1.c
:ENDCOMPILE
ECHO .
ECHO ***** Compiling Resources with MSVC 2022 64 bytes...
IF EXIST %1.rc "%ProgramFiles(x86)%\\Windows Kits\10\bin\10.0.22621.0\x64\rc" -r -D__64__ %1
echo %1.obj > msvc.tmp
rem echo %fwdir%\lib\FiveH64.lib %fwdir%\lib\FiveHC64.lib %fwdir%\lib\libmariadb64.lib >> msvc.tmp
echo %fwdir%\lib\FiveH64.lib %fwdir%\lib\FiveHC64.lib >> msvc.tmp
echo %fwdir%\lib\hbhpdf64.lib >> msvc.tmp
echo %fwdir%\lib\libhpdf64.lib >> msvc.tmp
echo %hdirl%\hbrtl.lib >> msvc.tmp
rem echo %hdirl%\hbvm.lib >> msvc.tmp NO MULTIHILOS
echo %hdirl%\hbvmmt.lib >> msvc.tmp
echo %hdirl%\gtgui.lib >> msvc.tmp
echo %hdirl%\hblang.lib >> msvc.tmp
echo %hdirl%\hbmacro.lib >> msvc.tmp
echo %hdirl%\hbrdd.lib >> msvc.tmp
echo %hdirl%\rddntx.lib >> msvc.tmp
echo %hdirl%\rddcdx.lib >> msvc.tmp
echo %hdirl%\rddfpt.lib >> msvc.tmp
echo %hdirl%\hbsix.lib >> msvc.tmp
echo %hdirl%\hbdebug.lib >> msvc.tmp
echo %hdirl%\hbcommon.lib >> msvc.tmp
echo %hdirl%\hbpp.lib >> msvc.tmp
echo %hdirl%\hbcpage.lib >> msvc.tmp
echo %hdirl%\hbwin.lib >> msvc.tmp
echo %hdirl%\hbct.lib >> msvc.tmp
echo %hdirl%\hbziparc.lib >> msvc.tmp
echo %hdirl%\hbmzip.lib >> msvc.tmp
echo %hdirl%\hbzlib.lib >> msvc.tmp
echo %hdirl%\hbpcre.lib >> msvc.tmp
echo %hdirl%\minizip.lib >> msvc.tmp
echo %hdirl%\xhb.lib >> msvc.tmp
echo %hdirl%\hbcplr.lib >> msvc.tmp
echo %hdirl%\png.lib >> msvc.tmp
echo %hdirl%\hbtip.lib >> msvc.tmp
echo %hdirl%\hbzebra.lib >> msvc.tmp
echo %hdirl%\libcurl.lib >> msvc.tmp
echo %hdirl%\hbcurl.lib >> msvc.tmp
echo %hdirl%\hbcomm.lib >> msvc.tmp
echo %hdirl%\hbmxml.lib >> msvc.tmp
echo %hdirl%\mxml.lib >> msvc.tmp
rem Uncomment these two lines to use Advantage RDD
rem echo %hdirl%\rddads.lib >> msvc.tmp
rem echo %hdirl%\ace32.lib >> msvc.tmp
echo kernel32.lib >> msvc.tmp
echo user32.lib >> msvc.tmp
echo gdi32.lib >> msvc.tmp
echo winspool.lib >> msvc.tmp
echo comctl32.lib >> msvc.tmp
echo comdlg32.lib >> msvc.tmp
echo advapi32.lib >> msvc.tmp
echo shell32.lib >> msvc.tmp
echo ole32.lib >> msvc.tmp
echo oleaut32.lib >> msvc.tmp
echo uuid.lib >> msvc.tmp
echo odbc32.lib >> msvc.tmp
echo odbccp32.lib >> msvc.tmp
echo iphlpapi.lib >> msvc.tmp
echo mpr.lib >> msvc.tmp
echo version.lib >> msvc.tmp
echo wsock32.lib >> msvc.tmp
echo msimg32.lib >> msvc.tmp
echo oledlg.lib >> msvc.tmp
echo psapi.lib >> msvc.tmp
echo gdiplus.lib >> msvc.tmp
echo winmm.lib >> msvc.tmp
echo vfw32.lib >> msvc.tmp
echo ws2_32.lib >> msvc.tmp
echo wininet.lib >> msvc.tmp
echo urlmon.lib >> msvc.tmp
echo strmiids.lib >> msvc.tmp
IF EXIST %1.res echo %1.res >> msvc.tmp
ECHO .
ECHO ***** Linking with MSVC 2022...
link @msvc.tmp /nologo /subsystem:windows /force:multiple /OUT:%1_64.exe
IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built *
%1_64.exe
GOTO EXIT
ECHO
:COMPILEERROR
ECHO .
ECHO ********************
ECHO * Compiling errors *
@type comp.log
@type warnings.log
ECHO * *
ECHO ********************
GOTO EXIT
:LINKERROR
ECHO .
ECHO ********************
ECHO * Linking errors *
GOTO EXIT
:SINTAX
ECHO SYNTAX: Build [Program] {-- No especifiques la extensión PRG
ECHO {-- Don't specify .PRG extension
GOTO EXIT
:NOEXIST
ECHO The specified PRG %1 does not exist
:EXIT
rem delete temporary files
@del %1.c
@del %1.obj
@del %1.ppo
@del %1.res
@del msvc.tmp
@del comp.log
@del warnings.log
rem Restaura las variables de ENTORNO
@set path=%oldpath%
@set include=%oldinclude%
@set lib=%oldlib%
@set libpath=%oldlibpath%
@set oldpath=""
@set oldinclude=""
@set oldlib=
@set oldlibpath=
function unafuncioncurl( )
curl_global_init()
return NIL
libcurl.dll
libeay32.dll
libssh2.dll
ssleay32.dll
zlib1.dll
#include "FiveWin.ch"
function Main()
MsgInfo( "ok" )
return nil
function unafuncioncurl( )
curl_global_init()
return NIL
#include "FiveWin.ch"
function Main()
MsgInfo( unafuncioncurl() )
return nil
function unafuncioncurl( )
curl_global_init()
return nil
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 99 guests