For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > March 2006 > RAPI









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RAPI
Big D

2006-03-30, 7:55 am

I am using the following RAPI version RemoteCE 0.1.0.3.

I have made a connection using Rapi but how do I copy a file to a target
directory to the handheld using Rapi.

I am trying to have some function that can be called once Rapi is intailized
that allows me or other to use by just passing in source and target of file.


Below is the function that intializes Rapi. I am looking to have a function
that does the copy.

Function ConnectRapi() As Long
Dim lcon As Long
Dim lRapiInit As RAPIINIT

With lRapiInit
.cbSize = Len(lRapiInit)
.heRapiInit = 0
.hrRapiInit = 0
End With

'this is an asyn call - returns immediately
lcon = CeRapiInitEx(lRapiInit)

If lcon = ERROR_SUCCESS Then

'we wait for 5 sec for a good connection
lcon = WaitForSingleObject(lRapiInit.heRapiInit, 5000)

'The state of the specified object is signaled
If lcon = WAIT_OBJECT_0 Then
'check if the return result is good
lcon = lRapiInit.hrRapiInit
End If

End If


ConnectRapi = lcon
End Function




Big D

2006-03-30, 6:56 pm

This file would be located on a desktop compter and with the activesync
connection copy to the device directory.

Any help is appreciated.

"Big D" <BigDaddy@newsgroup.nospam> wrote in message
news:%23GBKYY$UGHA.6084@TK2MSFTNGP14.phx.gbl...
>I am using the following RAPI version RemoteCE 0.1.0.3.
>
> I have made a connection using Rapi but how do I copy a file to a target
> directory to the handheld using Rapi.
>
> I am trying to have some function that can be called once Rapi is
> intailized that allows me or other to use by just passing in source and
> target of file.
>
>
> Below is the function that intializes Rapi. I am looking to have a
> function that does the copy.
>
> Function ConnectRapi() As Long
> Dim lcon As Long
> Dim lRapiInit As RAPIINIT
>
> With lRapiInit
> .cbSize = Len(lRapiInit)
> .heRapiInit = 0
> .hrRapiInit = 0
> End With
>
> 'this is an asyn call - returns immediately
> lcon = CeRapiInitEx(lRapiInit)
>
> If lcon = ERROR_SUCCESS Then
>
> 'we wait for 5 sec for a good connection
> lcon = WaitForSingleObject(lRapiInit.heRapiInit, 5000)
>
> 'The state of the specified object is signaled
> If lcon = WAIT_OBJECT_0 Then
> 'check if the return result is good
> lcon = lRapiInit.hrRapiInit
> End If
>
> End If
>
>
> ConnectRapi = lcon
> End Function
>
>
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com