FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC tftp class
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
tftp class
Posted: Tue Jan 23, 2007 08:56 PM

tftpfile() seems to bethe problem

I do not use it personnally, i use ftpgetfile and ftpputfile

Antonio ?

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
tftp class
Posted: Tue Jan 23, 2007 09:29 PM

Vilian,

Please download FWPPC again, it should be ok now

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
tftp class
Posted: Wed Jan 24, 2007 06:28 PM

Antonio,

Now it is generating the Exe, but when I try to connect it appears the following error:

Argument error
STR
Args:
[ 1] = U
stack calls:
STR(0)
INTERNETOPEN(0)
TINTERNET:NEW(0)

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
tftp class
Posted: Wed Jan 24, 2007 06:36 PM

Vilian,

Please check if you are have an InternetOpen() in your code

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
tftp class
Posted: Thu Jan 25, 2007 11:23 AM

Antonio,

I do not have a InternetOpen() in my code.

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
tftp class
Posted: Thu Jan 25, 2007 12:05 PM

Vilian,

Please download FWPPC again, thanks for your feedback

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
tftp class
Posted: Thu Jan 25, 2007 06:20 PM

Antonio,

Now the message is "cannot load WinInet.dll". I looked for in the Pocket for this archive but I did not find!

thanks for help.

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
tftp class
Posted: Thu Jan 25, 2007 07:03 PM

Vilian,

Please try this:

MsgInfo( LoadLibrary( "wininet.dll" ) )

and let us know what value you get, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
tftp class
Posted: Thu Jan 25, 2007 07:19 PM

Antonio,

This value is -2017256648

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
tftp class
Posted: Thu Jan 25, 2007 07:22 PM

Vilian,

Though you get the msg "cannot load WinInet.dll", does the application work fine ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
tftp class
Posted: Thu Jan 25, 2007 07:37 PM

Antonio,

The execution continues, but the archive is not sent for the site.

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
tftp class
Posted: Thu Jan 25, 2007 09:09 PM

Vilian,

Could you please post the code that you are testing ? thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
tftp class
Posted: Fri Jan 26, 2007 12:23 PM

Antonio,

This code is

FUNCTION EnvArqFtp(cArq)
LOCAL oInternet,oFtp,nVezes:=0,lInter:=.F.

 oInternet := TInternet():New()
 oFTP      := TFTP():New( "ip by server", oInternet,"usr","pass" )
 MandaArq(CurDir()+"\"+cArq,"/public_html/sav/"+cArq,500,oFTP)

RETURN NIL

STATIC FUNCTION MandaArq(cArquivo,cRemote,nTam,oFtp)
LOCAL n,hSource,cBuffer:=Space( 6400 ),nBufSize:=6400,oFile

IF (hSource := FOpen( cArquivo )) < 0
RETURN .F.
ELSE
cBuffer := Space( 6400 )
nBufSize := 6400
SysRefresh()

   oFile := TFtpFile():New( cRemote, oFTP )
   IF Empty(oFile)
       RETURN .F.
   ELSE
       oFile:OpenWrite()
       FSeek( hSource, 0, 0 )

      nTotal := 0
      DO WHILE ( nBytes := FRead( hSource, @cBuffer, nBufSize ) ) &gt; 0
    nFeito := oFile:Write( SubStr( cBuffer, 1, nBytes ) )
    SysRefresh()
    nTotal += nBytes
     ENDDO
     oFile:End()
     FClose( hSource )
 ENDIF

ENDIF

RETURN .T.

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
tftp class
Posted: Mon Jan 29, 2007 01:13 PM

Vilian,

We have tested your sample and checked these values:
MsgInfo( oFTP:hFTP )
MsgInfo( oFile:hFile )
they look ok, but InternetWriteFile() (oFile:Write()) is returning 0x87 for GetLastError(): ERROR_INVALID_PARAMETER
We don't know why it reports such value :-(

Have you tried to use FtpPutFile() instead of sending blocks ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
tftp class
Posted: Tue Jan 30, 2007 02:06 PM

Antonio,

I Tried to use FtpPutFile, but the system stops to answer without giving error message. You have an example of the use of this function?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil