Sub App_Start
Form1.Show
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\MyApp.exe")
= true then
rapi.CopyFileToDevice1(AppPath
& "\data.dat","\My
Documents")
rapi.DeviceShell("MyApp.exe","")
end if
End Sub
Example: Connecting using Connected event.
'Add a RAPIDesktop object named rapi.
Sub Globals
End Sub
Sub App_Start
Form1.Show
rapi.New1
rapi.Connect
End Sub
Sub rapi_Connected
if rapi.DeviceFileExists("\My Documents\MyApp.exe")
= true then
rapi.CopyFileToDevice1(AppPath
& "\data.dat","\My
Documents")
rapi.DeviceShell("MyApp.exe","")
end if
End Sub