URLDownloadToFile Error

URLDownloadToFile Error

Postby damianodec » Thu Nov 16, 2017 3:01 pm

hi,

I have this function:
Code: Select all  Expand view  RUN

DLL FUNCTION URLDOWNLOADTOFILE( pCaller AS LONG, cUrl AS LPSTR, cFileName AS LPSTR, nReserved AS DWORD, nFnCB AS LONG ) AS LONG;
    PASCAL FROM "URLDownloadToFileA" LIB "urlmon.dll"


and this code:
Code: Select all  Expand view  RUN

LOCAL hLib
...
hLib = LOADLIBRARY( "urlmon.dll")
IF !FILE("GIOGEN.EXE")
    if URLDOWNLOADTOFILE( 0, "\\192.168.1.198\pubblica\GIOGEN.EXE", "GIOGEN.EXE" ) = 0
    else
        MSGINFO("COLLEGAMENTO AL SERVER MANCANTE"+CRLF+ ;
                "CONTATTARE AMMINISTRATORE DI SISTEMA","01 - ATTENZIONE")
        lOk := .f.
    ENDIF
...
endif


and get this error:
Application
===========
Path and name: C:\DCasta\DCasta.exe (32 bits)
Size: 2,560,512 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20170902)
FiveWin Version: FWHX 11.12
Windows version: 6.2, Build 9200

Time from start: 0 hours 0 mins 6 secs
Error occurred at: 16-11-2017, 15:58:23
Error description: Error BASE/1089 Argument error: ABS
Args:
[ 1] = P 0x6D510000

Stack Calls
===========
Called from: => ABS( 0 )
Called from: chkexe.prg => URLDOWNLOADTOFILE( 0 )
Called from: chkexe.prg => CHKEXE( 39 )
Called from: DCasta.prg => (b)BUILDMENU( 201 )
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 461 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND( 1033 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3159 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 980 )
Called from: DCasta.prg => MAIN( 82 )

thank you for your help
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 421
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: URLDownloadToFile Error

Postby Enrico Maria Giordano » Thu Nov 16, 2017 3:13 pm

Provide a sample showing the problem, please.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: URLDownloadToFile Error

Postby damianodec » Thu Nov 16, 2017 3:41 pm

here you are:
Code: Select all  Expand view  RUN

#include "FiveWin.ch"

//----------------------------------------------------------------------------//
function chkexd(call1,oWnd)
local hlib
hLib = LOADLIBRARY( "urlmon.dll")

    if URLDOWNLOADTOFILE( 0, "\\192.168.1.198\pubblica\delete.bmp", "delete.bmp" ) = 0
    else
        MSGINFO("COLLEGAMENTO AL SERVER MANCANTE"+CRLF+ ;
                "CONTATTARE AMMINISTRATORE DI SISTEMA","01 - ATTENZIONE")
    ENDIF


return Nil

DLL FUNCTION URLDOWNLOADTOFILE( pCaller AS LONG, cUrl AS LPSTR, cFileName AS LPSTR, nReserved AS DWORD, nFnCB AS LONG ) AS LONG;
    PASCAL FROM "URLDownloadToFileA" LIB "urlmon.dll"



I use FWH 12.01 - bcc5.8
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 421
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: URLDownloadToFile Error

Postby Enrico Maria Giordano » Thu Nov 16, 2017 3:55 pm

The host is unreachable.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: URLDownloadToFile Error

Postby damianodec » Fri Nov 17, 2017 8:00 am

hi Enrico,
I have FiveWin for xHarbour 12.01 - Jan. 2012 and compiled by Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland

I have two folders with xHarbour:
- folder XHARBOUR is the original folder for FWH (SCENARIO 1)
- folder XHARBOUR55 is the folder unzipped from xHarbour Binaries 1.2.3 Rev. 10205 for BCC 5.5.1 downloaded from http://xharbour.org/index.asp?page=down ... naries_win (SCENARIO 2)

this is another .prg
Code: Select all  Expand view  RUN

#include "FiveWin.ch"

static oWnd

//----------------------------------------------------------------------------//

function Main()

   local oBar
   local oBrush
   local oPopup

   DEFINE BRUSH oBrush COLOR nRGB( 12, 129, 87 )

   DEFINE WINDOW oWnd FROM 1, 10 TO 20, 60 ;
      TITLE "Testing Buttons from disk" ;
      BRUSH oBrush

   DEFINE BUTTONBAR oBar OF oWnd _3D

   DEFINE BUTTON OF oBar FILE "..\bitmaps\16x16\Cut.bmp" ;
      ACTION chkexd() ;
      MESSAGE "Reading it from disk !!!"

   SET MESSAGE OF oWnd TO FWVERSION + " " + FWCOPYRIGHT

   ACTIVATE WINDOW oWnd

return nil

//----------------------------------------------------------------------------//

function chkexd()

    if URLDOWNLOADTOFILE( 0, "\\192.168.1.198\pubblica\1 -Sistema INFORMATICO\Button\delete.bmp", "delete.bmp", 0, 0 ) = 0
    else
        MSGINFO("COLLEGAMENTO AL SERVER MANCANTE"+CRLF+ ;
                "CONTATTARE AMMINISTRATORE DI SISTEMA","01 - ATTENZIONE")
    ENDIF
msginfo("ok")

return Nil


 DLL FUNCTION URLDOWNLOADTOFILE( pCaller AS LONG, cUrl AS LPSTR, cFileName AS LPSTR, nReserved AS DWORD, nFnCB AS LONG ) AS LONG;
    PASCAL FROM "URLDownloadToFileA" LIB "urlmon.dll"


this is BUILDX.BAT to compile SCENARIO (BCC 5.5 and FWH with original xHarbour)
Code: Select all  Expand view  RUN

@ECHO OFF
CLS
ECHO 旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴커
ECHO ?FiveWin for xHarbour 12.01 - Jan. 2012          xHarbour development power
ECHO ?(c) FiveTech, 1993-2012     for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7
ECHO 읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴켸?
ECHO  賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽?

if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST

ECHO Compiling...

set FWDIR=.\..\
set XHDIR=c:\xharbour
rem if "%FWDIR%" == "" set FWDIR=.\..\
rem if "%XHDIR%" == "" set XHDIR=c:\xharbour
rem if "%2" == "/b" set GT=gtwin
rem if not "%2" == "/b" set GT=gtgui
set GT=gtgui

set hdir=%XHDIR%
set hdirl=%hdir%\lib
set bcdir=c:\borland\bcc55
set fwh=%FWDIR%

%hdir%\bin\harbour %1 /n /i%fwh%\include;%hdir%\include /w /p %2 %3 > comp.log
IF ERRORLEVEL 1 GOTO COMPILEERRORS
@type comp.log

echo -O2 -e%1.exe -I%hdir%\include -I%bcdir%\include %1.c > b32.bc
%bcdir%\bin\bcc32 -M -c -v @b32.bc
:ENDCOMPILE

IF EXIST %1.rc %bcdir%\bin\brc32 -r -I%bcdir%\include %1

echo /aa + > b32.bc
echo /Gn + >> b32.bc
echo /Tpe + >> b32.bc
echo /s + >> b32.bc
echo /v + >> b32.bc
echo /Lc:\fwh\lib;c:\xharbour\lib;c:\borland\bcc55\lib;c:\borland\bcc55\lib\psdk;C:\fwh\INCLUDE;c:\xharbour\INCLUDE;c:\borland\bcc55\INCLUDE + >> b32.bc
echo c0w32.obj + >> b32.bc
echo %bcdir%\lib\c0w32.obj + > b32.bc
echo %1.obj, + >> b32.bc
echo %1.exe, + >> b32.bc
echo %1.map, + >> b32.bc
echo %fwh%\lib\Fivehx.lib %fwh%\lib\FiveHC.lib + >> b32.bc
echo %hdirl%\rtl.lib + >> b32.bc
echo %hdirl%\vm.lib + >> b32.bc
echo %hdirl%\%GT%.lib + >> b32.bc
echo %hdirl%\lang.lib + >> b32.bc
echo %hdirl%\macro.lib + >> b32.bc
echo %hdirl%\rdd.lib + >> b32.bc
echo %hdirl%\dbfntx.lib + >> b32.bc
echo %hdirl%\dbfcdx.lib + >> b32.bc
echo %hdirl%\dbffpt.lib + >> b32.bc
echo %hdirl%\hbsix.lib + >> b32.bc
echo %hdirl%\debug.lib + >> b32.bc
echo %hdirl%\common.lib + >> b32.bc
echo %hdirl%\pp.lib + >> b32.bc
echo %hdirl%\pcrepos.lib + >> b32.bc
echo %hdirl%\ct.lib + >> b32.bc
echo %hdirl%\zlib.lib + >> b32.bc
echo %hdirl%\hbzip.lib + >> b32.bc
echo %hdirl%\png.lib + >> b32.bc
echo %hdirl%\tip.lib + >> b32.bc

rem Uncomment these two lines to use Advantage RDD
rem echo %hdir%\lib\rddads.lib + >> b32.bc
rem echo %hdir%\lib\Ace32.lib + >> b32.bc

echo %bcdir%\lib\cw32.lib + >> b32.bc
echo %bcdir%\lib\import32.lib + >> b32.bc
echo %bcdir%\lib\psdk\odbc32.lib + >> b32.bc
echo %bcdir%\lib\psdk\rasapi32.lib + >> b32.bc
echo %bcdir%\lib\psdk\nddeapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\msimg32.lib + >> b32.bc
echo %bcdir%\lib\psdk\psapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\iphlpapi.lib, >> b32.bc

rem echo %bcdir%\lib\psdk\gdiplus.lib + >> b32.bc

IF EXIST %1.res echo %1.res >> b32.bc

rem uncomment this line to use the debugger and comment the following one
if %GT% == gtwin %bcdir%\bin\ilink32 -Gn -Tpe -s -v @b32.bc
IF ERRORLEVEL 1 GOTO LINKERROR
if %GT% == gtgui %bcdir%\bin\ilink32 -Gn -aa -Tpe -s -v @b32.bc
IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built *
%1
GOTO EXIT
ECHO

rem delete temporary files
@del %1.c

:COMPILEERRORS
@type comp.log
ECHO * Compile errors *
GOTO EXIT

:LINKERROR
ECHO * Linking errors *
GOTO EXIT

:SINTAX
ECHO    SYNTAX: Build [Program]     {-- No especifiques la extensi? PRG
ECHO                                {-- Don't specify .PRG extension
GOTO EXIT

:NOEXIST
ECHO The specified PRG %1 does not exist

:EXIT


compiled and run .exe, press button for ACTION chkexd() and works.

Then I changed XHDIR in BUILDX.BAT and put XHARBOUR55 (SCENARIO 2)

it compiled and when I press button for ACTION chkexd() get this error:
Application
===========
Path and name: C:\fwh\samples\testbtnd.exe (32 bits)
Size: 1,790,976 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20170902)
FiveWin Version: FWHX 11.12
Windows version: 6.2, Build 9200

Time from start: 0 hours 0 mins 1 secs
Error occurred at: 11/17/17, 08:57:45
Error description: Error BASE/1089 Argument error: ABS
Args:
[ 1] = P 0x6D510000

Stack Calls
===========
Called from: => ABS( 0 )
Called from: testbtnd.prg => URLDOWNLOADTOFILE( 0 )
Called from: testbtnd.prg => CHKEXD( 37 )
Called from: testbtnd.prg => (b)MAIN( 25 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 465 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 656 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1690 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1407 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3159 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 980 )
Called from: testbtnd.prg => MAIN( 29 )

System
======
CPU type: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz 2400 Mhz
Hardware memory: 4279 megs
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 421
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 48 guests