by Colin Haig » Sun Jul 12, 2009 1:08 am
Hi Enrico
Here is the code - I have removed as much as possible
There is a sub folder called BMP - c:\mobapp\bmp
Thanks for your assistance
Colin
#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
#define INTERNET_FLAG_PASSIVE 134217728
//
// flags for FTP
//
#define INTERNET_FLAG_TRANSFER_ASCII 1
#define INTERNET_FLAG_TRANSFER_BINARY 2
#define SHFS_HIDETASKBAR 2 // 0x0002 //2
#define SHFS_SHOWSIPBUTTON 4 // 0x0004
#define SHFS_HIDESIPBUTTON 8 // 0x0008 //8
#define SHFS_SHOWSTARTICON 16 // 0x0010
#define SHFS_HIDESTARTICON 20 // 0x0020 //
#define TRUE .T.
#define FALSE .F.
#include "C:\FWPPC\INCLUDE\FWCE.CH"
static oWnd
function Main()
local oFont
REQUEST DBFCDX,DBFFPT
RddSetDefault('DBFCDX')
config()
use(curdir() +'\user')
cIntls := user->intls
cName := user->employee
use
DEFINE FONT oFont NAME "Cambria" SIZE 0,-9
DEFINE WINDOW oWnd
ShFullScreen(oWnd:hwnd,SHFS_HIDESTARTICON )
ShFullScreen(oWnd:hwnd,SHFS_HIDETASKBAR )
ACTIVATE WINDOW oWnd ;
ON INIT(MoveWindow(oWnd:hWnd,0,0,300,320),;
Control())
dbCloseall()
oFont:end()
return nil
//---------------------------------------------------------------------------//
function config()
set date british
set softseek on
set confirm on
set deleted on
set century on
set epoch to 1960
return(nil)
//---------------------------------------------------------------------------//
static function Control()
local lClean := FALSE
@50,25 BTNBMP FILE Curdir() +'\bmp\clock_red.bmp' SIZE 28, 28 OF oWnd ;
ACTION(Timesheets(cIntls,cName))
@50,100 BTNBMP FILE Curdir() +'\bmp\transmit.bmp' SIZE 28, 28 OF oWnd ;
ACTION(Connect())
@50,175 BTNBMP FILE Curdir() +'\bmp\group.bmp' SIZE 28, 28 OF oWnd ;
ACTION(ShowAll(cIntls,cName))
@100,25 BTNBMP FILE Curdir() +'\bmp\house.bmp' SIZE 28, 28 OF oWnd ;
ACTION(lClean := FALSE,Maint(lClean))
@100,100 BTNBMP FILE Curdir() +'\bmp\delete.bmp' SIZE 28, 28 OF oWnd ;
ACTION(lClean := TRUE,Maint(lClean))
@100,175 BTNBMP FILE Curdir() +'\bmp\exit.bmp' SIZE 28, 28 OF oWnd ;
ACTION(dbCloseAll(),oWnd:end())
return(nil)
//---------------------------------------------------------------------------//
static function Timesheets(cIntls,cName)
MsgInfo('timesheet code')
return(nil)
//--------------------------------------------------------------//
static function ShowAll()
MsgInfo('display all records in browse')
return(nil)
//-----------------------------------------------------------------//
static function files()
MsgInfo('check for indexes')
return(nil)
//---------------------------------------------------------------------------------------//
static function Maint(lClean)
MsgInfo('re index')
RETURN(NIL)
//-----------------------------------------------------------------------------------------//
static function Connect()
LOCAL hInternet, hConnect
// I have tried "anystring" as well as the IP
hInternet = INTERNETOPEN( "99.9.9.999", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )
if hInternet == 0
MsgInfo('No Internet')
endif
hConnect = INTERNETCONNECT( hInternet,"99.9.9.999",INTERNET_DEFAULT_FTP_PORT, "admin", "#pass",
INTERNET_SERVICE_FTP,INTERNET_FLAG_PASSIVE, 0 )
IF HConnect == 0
MSGINFO("Error on FTP Connection ")
RETURN .F.
ENDIF
if ! FTPPUTFILE( hConnect, "\\My Storage\MobApp\error.txt", "c:\fpt\error.txt", 0, 0 )
MsgAlert('FTP failed') // fails here
endif
INTERNETCLOSEHANDLE( hConnect )
INTERNETCLOSEHANDLE( hInternet )
RETURN(NIL)