FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Pocket PC Ayuda Por Favor
Posts: 24
Joined: Wed Nov 18, 2009 02:58 PM
Ayuda Por Favor
Posted: Thu Jan 28, 2010 12:09 PM

Amigo Antonio me averiguaste lo de :

1.- Error para envio y recepcion por FTP ( Error con el PRG que te envie )
2.- Existe alguna forma en FWPPC de comprimir varios archivos tipo ZIP para luego enviarlos por correo.
3.- Donde puedo averiguar lo de las clases que me dijiste de correo ( sintaxis )
4.- Como puedo hacer para llamar de un PRG a otro PRG
5.- Si tengo una Pantalla con menu inferior y en ese mismo PRG llamo a otra pantalla con menu inferior como hago para que los 2 utilicen el mismo RC o tengo que crear 2 RC diferentes.

Gracias de antemano

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Por Favor
Posted: Thu Jan 28, 2010 01:30 PM
Julio,

1) Tienes que comprobar que tu configuraci贸n de internet en el dispositivo movil sea correcta. Lo mas sencillo es probar a acceder a una p谩gina web.

2) No hay soporte de ZIPs. Algunos usuarios han implementado algunas soluciones, pero no son ZIP 100% estandard.

3) Aqui tienes un ejemplo de como se envia un email usando TSmtp:
Code (fw): Select all Collapse
function SendMail()

   local oOutMail, cIP

   oWnd:SetMsg( "Sending Internet email..." )

   WSAStartup()
   oOutMail := TSmtp():New( cIP := GetHostByName( "mail.fivetechsoft.com" ) )
   MsgInfo( cIP )

   oOutMail:bConnecting = { || oWnd:SetMsg( "Connecting to smtp.fivetechsoft.com..." ) }
   oOutMail:bConnected  = { || oWnd:SetMsg( "Connected" ) }
   oOutMail:bDone       = { || oWnd:SetMsg( "Message sent successfully" ) }

   oOutMail:SendMail( "alinares@fivetechsoft.com",;     // From
                      { "alinares@fivetechsoft.com" },; // To
                      "It is working!!!",;              // Msg Text
                      "Testing FiveWin Class TSmtp enhancements",; // Subject
                      { "testsmtp.prg", "testsmtp.zip" } )  // attached files

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Por Favor
Posted: Thu Jan 28, 2010 01:33 PM
4) para llamar de un PRG a otro PRG, declaras una funci贸n y la llamas por su nombre. Por ejemplo:

uno.prg
Code (fw): Select all Collapse
...
Otro()
...


dos.prg
Code (fw): Select all Collapse
function Otro()

   ... c贸digo

return (valor a devolver)

Para compilar m煤ltiples PRGs puedes usar samples\FWCE.bat modificado 贸 usar un fichero make. Tienes un ejemplo de fichero make en FWPPC\makes\fwcemake.zip
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Por Favor
Posted: Thu Jan 28, 2010 01:34 PM

5) Lo habitual es usar un solo fichero RC para toda la aplicaci贸n, no importando cuantos PRGs uses.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Por Favor
Posted: Thu Jan 28, 2010 01:38 PM

Pruebas de compresi贸n y descompresi贸n (ZIP) que se han hecho:

viewtopic.php?f=7t=5603start=0

&&

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 24
Joined: Wed Nov 18, 2009 02:58 PM
Re: Ayuda Por Favor
Posted: Thu Jan 28, 2010 03:33 PM

1.- "Tienes que comprobar que tu configuraci贸n de internet en el dispositivo movil sea correcta. Lo mas sencillo es probar a acceder a una p谩gina web"

Ya el HandHelp esta configurado correctamente como te habia escrito antes, y puedo navegar en el, es posible que me haya equivocado en el PRG, puedes revirsarlo y decirme si el error es ahi, hermano. Donde dice Anystring hay que colocar algo.

2.- Existe alguna forma de llamar al Outlook desde programacion.

Y gracias nuevamente por tu ayuda mi amigo.

PRG - Ftp:

include "Fwce.ch"

//
// File attributes
//

define FILE_ATTRIBUTE_READONLY 1

define FILE_ATTRIBUTE_HIDDEN 2

define FILE_ATTRIBUTE_SYSTEM 4

define FILE_ATTRIBUTE_DIRECTORY 16

define FILE_ATTRIBUTE_ARCHIVE 32

define FILE_ATTRIBUTE_NORMAL 128

define FILE_ATTRIBUTE_TEMPORARY 256

//
// access types for InternetOpen()
//

define INTERNET_OPEN_TYPE_PRECONFIG 0 // use registry configuration

define INTERNET_OPEN_TYPE_DIRECT 1 // direct to net

define INTERNET_OPEN_TYPE_PROXY 3 // via named proxy

define INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY 4 // prevent using java/script/INS

//
// manifests
//

define INTERNET_INVALID_PORT_NUMBER 0 // use the protocol-specific default

define INTERNET_DEFAULT_FTP_PORT 21 // default for FTP servers

define INTERNET_DEFAULT_GOPHER_PORT 70 // " " gopher "

define INTERNET_DEFAULT_HTTP_PORT 80 // " " HTTP "

define INTERNET_DEFAULT_HTTPS_PORT 443 // " " HTTPS "

define INTERNET_DEFAULT_SOCKS_PORT 1080 // default for SOCKS firewall servers.

//
// service types for InternetConnect()
//

define INTERNET_SERVICE_FTP 1

define INTERNET_SERVICE_GOPHER 2

define INTERNET_SERVICE_HTTP 3

//
// flags for FTP
//

define INTERNET_FLAG_TRANSFER_ASCII 1

define INTERNET_FLAG_TRANSFER_BINARY 2

FUNCTION MAIN()

LOCAL hInternet, hConnect

hInternet = INTERNETOPEN( "Anystring", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )

\ donde dice Anystring hay que colocar algo

hConnect = INTERNETCONNECT( hInternet, "FTP://LAPERCHA.DYNDNS.ORG", INTERNET_INVALID_PORT_NUMBER, "usuario", "clave", INTERNET_SERVICE_FTP, 0, 0 )

? FTPPUTFILE( hConnect, "envia.txt", "envia.txt", 0, 0 )

INTERNETCLOSEHANDLE( hConnect )

INTERNETCLOSEHANDLE( hInternet )

RETURN NIL

pragma BEGINDUMP

include "windows.h"

include "wininet.h"

include "hbapi.h"

LPWSTR AnsiToWide( LPSTR );

HB_FUNC( INTERNETOPEN )
{
LPWSTR cAgent = AnsiToWide( hb_parc( 1 ) );
LPWSTR cProxyName = AnsiToWide( hb_parc( 3 ) );
LPWSTR cProxyBypass = AnsiToWide( hb_parc( 4 ) );

HINTERNET hInternet = InternetOpen( cAgent, hb_parnl( 2 ), cProxyName, cProxyBypass, hb_parnl( 5 ) );

hb_xfree( cAgent ); 
hb_xfree( cProxyName ); 
hb_xfree( cProxyBypass );

hb_retnl( ( LONG ) hInternet );

}

HB_FUNC( INTERNETCLOSEHANDLE )
{
hb_retl( InternetCloseHandle( ( HINTERNET ) hb_parnl( 1 ) ) );
}

HB_FUNC( INTERNETCONNECT )
{
LPWSTR cServerName = AnsiToWide( hb_parc( 2 ) );
LPWSTR cUserName = AnsiToWide( hb_parc( 4 ) );
LPWSTR cPassword = AnsiToWide( hb_parc( 5 ) );

HINTERNET hInternet = InternetConnect( ( HINTERNET ) hb_parnl( 1 ), cServerName, ( INTERNET_PORT ) hb_parnl( 3 ), cUserName, cPassword, hb_parnl( 6 ), hb_parnl( 7 ), hb_parnl( 8 ) );

hb_xfree( cServerName ); 
hb_xfree( cUserName ); 
hb_xfree( cPassword );

hb_retnl( ( LONG ) hInternet );

}

HB_FUNC( FTPGETFILE )
{
LPWSTR cRemoteFile = AnsiToWide( hb_parc( 2 ) );
LPWSTR cNewFile = AnsiToWide( hb_parc( 3 ) );

hb_retl( FtpGetFile( ( HINTERNET ) hb_parnl( 1 ), cRemoteFile, cNewFile, hb_parl( 4 ), hb_parnl( 5 ), hb_parnl( 6 ), hb_parnl( 7 ) ) );

hb_xfree( cRemoteFile ); 
hb_xfree( cNewFile );

}

HB_FUNC( FTPPUTFILE )
{
LPWSTR cLocalFile = AnsiToWide( hb_parc( 2 ) );
LPWSTR cNewRemoteFile = AnsiToWide( hb_parc( 3 ) );

hb_retl( FtpPutFile( ( HINTERNET ) hb_parnl( 1 ), cLocalFile, cNewRemoteFile, hb_parnl( 4 ), hb_parnl( 5 ) ) );

hb_xfree( cLocalFile ); 
hb_xfree( cNewRemoteFile );

}

pragma ENDDUMP

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Por Favor
Posted: Thu Jan 28, 2010 05:58 PM

Julio,

"Anystring" sirve. Es cualquier nombre que quieras usar.

Prueba a usar MsgInfo() para ver que valores toman hInternet y hConnection:

hInternet = INTERNETOPEN( "Anystring", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )

MsgInfo( hInternet )

hConnect = INTERNETCONNECT( hInternet, "Your ftp address", INTERNET_INVALID_PORT_NUMBER, "userid", "password", INTERNET_SERVICE_FTP, 0, 0 )

MsgInfo( hConnect )

Y dime que muestran hInternet y hConnect, gracias :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion