Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Using rapi from desktop to copy file from device to desktop


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-07-2008, 06:18 PM
Junior Member
 
Join Date: Dec 2007
Posts: 32
Default Using rapi from desktop to copy file from device to desktop

It should be so simple, but it's not working.
I have made a simple program (almost the example):

I want to copy the file LGXVRDmu.CSV from my device (in \My Documents) to my desktop computer. I am using activesync and it's connected OK.
Two problems:
1. my programs says 'cannot connect to device.'
2. if i delete this check (rapi.isconneted=true) I get a new error that he can not write.

Sub Button2_Click
rapi.New1
rapi.Connect
t = Now '3 seconds timeout.
Do Until rapi.IsConnected = true
DoEvents
If (Now - t)/cTicksPerSecond > 3 Then
Msgbox("Cannot connect to device.")
AppClose
End If
Loop
If rapi.DeviceFileExists("\My Documents\LGXVRDmu.CSV") = true Then
rapi.CopyFileFromDevice1("\My Documents\LGXVRDmu.CSV",AppPath)
End If
End Sub
Reply With Quote
  #2 (permalink)  
Old 01-07-2008, 06:26 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,956
Default

Did you connect the device before running the program? (you should)
Try to increase the time limit.

What is your ActiveSync version?
Reply With Quote
  #3 (permalink)  
Old 01-08-2008, 04:33 PM
Junior Member
 
Join Date: Dec 2007
Posts: 32
Default

I have made it wait 10 secs; same problem.
The PPC is connected before starting the program.
I am using activesync 4.5
Strange...

Last edited by sunnyboyj : 01-08-2008 at 04:36 PM.
Reply With Quote
  #4 (permalink)  
Old 01-08-2008, 04:41 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,956
Default

You could try to uninstall and reinstall Activesync.
Another option is to use a different approach and send the file using Network library (based on Activesync connection).
Reply With Quote
  #5 (permalink)  
Old 01-08-2008, 06:24 PM
Junior Member
 
Join Date: Dec 2007
Posts: 32
Default

I tried it but does not work. Then I cut my program in pieces:
I get the message 'connected'
I get the message 'file found' (so it can get the file when i start the program from desktop)
Then I get the error message, I think my syntax is just not correct:
Error is: Not a valid boolean (translated from Dutch error message).
I think I make an error copying from device (\My Documents\LGXVRDMU.CSV)
to my desktop: C:\downloads\

Form1.Show
rapi.New1
rapi.Connect
Sub Button2_Click
Msgbox ("Connected")

If rapi.DeviceFileExists("\My Documents\LGXVRDMU.CSV") = true Then
Msgbox("File Found")
rapi.CopyFileFromDevice2("\My Documents\LGXVRDMU.CSV","C:\downloads")
End If

End Sub
Reply With Quote
  #6 (permalink)  
Old 01-09-2008, 05:06 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,956
Default

This code copies a file from the device to the desktop (to the current path):
Code:
Sub Globals
End Sub

Sub App_Start
    Form1.Show
    rapi.New1
    rapi.Connect
End Sub

Sub Rapi_Connected
    Msgbox("connected")
    If rapi.DeviceFileExists("\My Documents\a.exe") = true Then
        Msgbox("file exists")
        rapi.CopyFileFromDevice1("\My Documents\a.exe",AppPath)
    End If
End Sub
Reply With Quote
  #7 (permalink)  
Old 02-07-2008, 02:53 PM
Newbie
 
Join Date: Feb 2008
Posts: 6
Default and use the same in device

and I want make the same but from on aplication on the device.

I execute the programe on the device and Iwant copy 1 file from the device to de c:\ directory???
Reply With Quote
  #8 (permalink)  
Old 02-07-2008, 05:07 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,956
Default

It is not possible with the RAPI library.
You can use the Network library to send the file.
Reply With Quote
  #9 (permalink)  
Old 02-08-2008, 10:37 AM
Newbie
 
Join Date: Feb 2008
Posts: 6
Default ok

Quote:
Originally Posted by Erel View Post
It is not possible with the RAPI library.
You can use the Network library to send the file.
Ok.
for exemple I have a secret file and on clik botton1 (using network) lib the file is copied from de device to the pc.
exemp:

FileCopy("pass.ert","c:\pass.ert") - but using the network

O I make this??????

sory mi inglish
Reply With Quote
  #10 (permalink)  
Old 02-08-2008, 11:40 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,956
Default

See the FileTransfer example: http://www.basic4ppc.com/Downloads.html
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Web browser for desktop and device agraham Additional Libraries 42 09-11-2008 07:37 AM
FileSize(file) brings up error on device - but not on Desktop TWELVE Questions & Help Needed 7 05-10-2008 02:54 PM
Using RAPI library to transfer database from device to desktop mozaharul Questions & Help Needed 4 04-01-2008 08:55 AM
Different behaviour DeskTop and Device HARRY Questions & Help Needed 2 02-22-2008 12:36 PM
Problems using rapi to send files to desktop sunnyboyj Questions & Help Needed 4 01-06-2008 05:40 AM


All times are GMT. The time now is 02:51 PM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0