I'm doing small program using VB 6 to tests receive/send from/to pocketpc
pda files.

I have used DeviceToDesktop function successfully but DesktopToDevice not
jet.

Some helps mention CERapiInit or CERapiInitEx functions from rapi.dll should
be used before above functions to clear Windows CE Rapi but I don't know how
I should declare CERapiInit function.

Code used:

Private Declare Function DESKTOPTODEVICE Lib _
"c:\program files\Microsoft ActiveSync\adofiltr.dll" _
(ByVal desktoplocn As String, _
ByVal tablelist As String, _
ByVal sync As Boolean, _
ByVal overwrite As Integer, _
ByVal devicelocn As String) As Long

Private Declare Function DEVICETODESKTOP Lib _
"c:\program files\Microsoft ActiveSync\adofiltr.dll" _
(ByVal desktoplocn As String, _
ByVal tablelist As String, _
ByVal sync As Boolean, _
ByVal overwrite As Integer, _
ByVal devicelocn As String) As Long
...
Dim Lresult As String
Lresult = 0
Lresult = DESKTOPTODEVICE(App.Path & "\prueba.mdb", "Clientes..", False,
True, "\prueba.cdb")
...

*****
Above function returns 0 then it have success.
*****

Lresult = 0
Lresult = DESKTOPTODEVICE(App.Path & "\prueba.mdb", "Clientes..", False,
True, "\prueba.cdb")
...

*****
Above function returns -2146824448 then it have not success.
*****

How should I declare CERapiInit function?

Maybe I'm doing something else wrong. What could be?

THANKS!

Re: DeviceToDesktop/DesktopToDevice Function by Peter

Peter
Mon May 30 11:10:11 CDT 2005

From ActiveSync 3.7 the desktoptodevice function no longer overwrites an
existing database, so check if the remote file exists first and if so
delete/rename/move it first.

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://www.peterfoot.net |
http://www.opennetcf.org

"Solomon" <inteca@NOracsa.co.cr> wrote in message
news:O8R8j$5YFHA.3096@TK2MSFTNGP15.phx.gbl...
> I'm doing small program using VB 6 to tests receive/send from/to pocketpc
> pda files.
>
> I have used DeviceToDesktop function successfully but DesktopToDevice not
> jet.
>
> Some helps mention CERapiInit or CERapiInitEx functions from rapi.dll
> should be used before above functions to clear Windows CE Rapi but I don't
> know how I should declare CERapiInit function.
>
> Code used:
>
> Private Declare Function DESKTOPTODEVICE Lib _
> "c:\program files\Microsoft ActiveSync\adofiltr.dll" _
> (ByVal desktoplocn As String, _
> ByVal tablelist As String, _
> ByVal sync As Boolean, _
> ByVal overwrite As Integer, _
> ByVal devicelocn As String) As Long
>
> Private Declare Function DEVICETODESKTOP Lib _
> "c:\program files\Microsoft ActiveSync\adofiltr.dll" _
> (ByVal desktoplocn As String, _
> ByVal tablelist As String, _
> ByVal sync As Boolean, _
> ByVal overwrite As Integer, _
> ByVal devicelocn As String) As Long
> ...
> Dim Lresult As String
> Lresult = 0
> Lresult = DESKTOPTODEVICE(App.Path & "\prueba.mdb", "Clientes..", False,
> True, "\prueba.cdb")
> ...
>
> *****
> Above function returns 0 then it have success.
> *****
>
> Lresult = 0
> Lresult = DESKTOPTODEVICE(App.Path & "\prueba.mdb", "Clientes..", False,
> True, "\prueba.cdb")
> ...
>
> *****
> Above function returns -2146824448 then it have not success.
> *****
>
> How should I declare CERapiInit function?
>
> Maybe I'm doing something else wrong. What could be?
>
> THANKS!
>