Page 1 of 2

Problem with FTP

Posted: Thu Apr 17, 2008 3:18 pm
by Maurizio
Hello Antonio

I have this problems with oFtp:Directory

With FW7.07 I used
aFiles = oFTP:Directory( "filelist\01\")
and works

Now with FW 8.03 I have this error
Error description: Error BASE/1066 Parametro errato: condizionale

Thank MAurizio

Posted: Thu Apr 17, 2008 8:28 pm
by vilian
Hi Maurizio,

Change

aFiles = oFTP:Directory( "filelist\01\")

to

aFiles := oFTP:Directory( "filelist\01\")

Posted: Fri Apr 18, 2008 6:27 am
by Maurizio
Thank Vilian
but the problem remain

Maurizio

Posted: Fri Apr 18, 2008 12:04 pm
by Antonio Linares
Maurizio,

Please compile source\classes\tftp.prg as another PRG of your application and check in what line number the error is generated, thanks

My guess is that the error is coming from here:
while InternetFindNextFile( hFTPDir, @cBuffer )
but just to be sure

Posted: Fri Apr 18, 2008 12:11 pm
by Maurizio
Antonio

Yes the error is at the line

while InternetFindNextFile( hFTPDir, @cBuffer )

I have the first file with
hFTPDir = FtpFindFirstFile( ::hFTP, cMask, @cBuffer, 0, 0 )




Regards MAurizio

Posted: Fri Apr 18, 2008 12:30 pm
by Antonio Linares
Maurizio,

InternetFindNextFile( hFTPDir, @cBuffer ) should return a logical value. Its real strange that it is not returning it.

Have you modified that function ?

Posted: Fri Apr 18, 2008 12:48 pm
by Maurizio
Antonio,

< Have you modified that function ?

absolutely no

MAurizio

Posted: Fri Apr 18, 2008 1:01 pm
by Antonio Linares
Maurizio,

Lets modify the source code to check whats going on:

Code: Select all

   local lResult
   ...

         while ValType( lResult := InternetFindNextFile( hFTPDir, @cBuffer ) ) == "L" .and. lResult
            oWin32FindData:cBuffer = cBuffer
            AAdd( aFiles, { oWin32FindData:cFileName,;
                            oWin32FindData:nSizeLow,;
                            FileTimeToDate( oWin32FindData:nLastWriteAccess ),;
                            FileTimeToTime( oWin32FindData:nLastWriteAccess ) } )
         end
Thanks for your feedback,

Posted: Fri Apr 18, 2008 2:33 pm
by Maurizio
Antonio ,

With your modify the programm work
but in aFiels I have only the first file .

Regards MAurizio

Posted: Fri Apr 18, 2008 7:45 pm
by Antonio Linares
Maurizio,

Please add this code to your main PRG and try it again, thanks:

Code: Select all

#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
#include <wininet.h>

HB_FUNC( INTERNETFINDNEXTFILE )
{
   hb_retl( InternetFindNextFile( ( HINTERNET ) hb_parnl( 1 ), 
                              ( LPWIN32_FIND_DATA ) hb_parc( 2 ) ) );
}
#pragma ENDDUMP

Posted: Sat Apr 19, 2008 5:56 am
by Maurizio
Antonio ,

Thank I add the function HB_FUNC( INTERNETFINDNEXTFILE )
and it works .

I compare it with the one in wininetx.c and it's the same ???

What is strange is that when I have a error instead to have the error list of FW I had the list of xHArbour , maybe the problem is related ?



Thank Maurizio

Posted: Sat Apr 19, 2008 7:09 am
by Antonio Linares
Maurizio,

wininetx.c has not been placed inside FiveHC.lib yet. Instead we are still using source\winapi\wininet.prg

Please run samples\TestErro.prg. You should get FWH error dialog box, unless you have modified the errorsys yourself or you are linking the libraries in a different order, thanks

Posted: Mon Apr 21, 2008 8:12 am
by Maurizio
Antonio ,
there is a same pronblem with
oFtp:DeleteFile

I insert :
HB_FUNC( FTPDELETEFILE )
{
hb_retl( FtpDeleteFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ) ) );
}

And now work

Regards MAurizio

Posted: Mon Apr 21, 2008 8:13 am
by Antonio Linares
Maurizio,

We need to remove wininet.prg and add wininetx.c

Posted: Wed Apr 23, 2008 10:58 am
by Marco Turco
Hi Antonio,
I have the same problem using the FTP functions.

Do you already have an updated lib that fix it ?

Thanks