ActiveSync


G

Glyn Meek

What is the best way to produce a routine on the Pocket PC that will enable
me to use the Active Sync link to synchronize data files between the Pocket
PC and the Desktop WITHOUT the user having to get into the intricacies of
ActiveSync and having to set up there own File Synchronization etc.

I have a file in directory a on the desktop and directory b on the Pocket PC
(a and b will alwsy be the same) and I just want to have the files sync
automatically. I am aiming at 'less than computer savvy' customers, and
need this to be SIMPLE.

Anyone know of any white papers, or third party packages/routines that might
help?

Regards

Glyn J Meek
 
Ad

Advertisements

D

Darren Shaffer

The topic you're referring to is called a Custom ActiveSync Provider
using RAPI or Remote API. Best reference available is Doug Boling's
book Programming Windows CE.Net from MSPress.

Having written one of these, I can tell you it's nontrivial and is a C++
project,
not a Compact Framework project.

-Darren Shaffer
 
P

Peter Foot [MVP]

A really simple way would be to write a small desktop executable using RAPI
to transfer files, you can do this from .NET code using OpenNETCF's
Communications library -
http://www.opennetcf.org/PermaLink.aspx?guid=d7b7cbef-4ab6-477b-924c-0498a523beaf

You can launch your desktop app when ActiveSync connects using the registry
keys at:-
a.. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE
Services\AutoStartOnConnect
b.. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE
Services\AutoStartOnDisconnect
See
http://msdn.microsoft.com/library/en-us/wceconct/html/_wcesdk_Registry-based_Notification.asp
for more details.

Peter
 
G

Glyn Meek

Peter...PERFECT...I have downloaded the OpenNETCF Communications library,
and it appears to have ALL the methods I need...however, since this is the
first time I have used OpenNETCF code I am struggling a little to integrate
it into my application and call the methods.

I have added the .dll to my reference list and inserted
Imports OpenNETCF.Desktop.Communication

at the beginning of my routine. What else do I need to do so I can actually
access the methods in my code?

Regards

Glyn
 
C

Chris Tacke, eMVP

If you've got the DLL, simply adding a reference and an "Imports" statement
should be all you need. You can also add the entire source project to your
solution and reference it internally.

--
<ctacke/>
www.OpenNETCF.org
Your CF searches start and end here
 
G

Glyn Meek

Thanks Chris...this is the first time I have used anything from the
OpenNETCF and I am IMPRESSED...my thanks to those souls who put this code
out there!!!!

The routines work perfectly, but I have to admit that the documentation
leaves something to be desired wrt examples. Still, I suppose if you are
using this stuff, it is assumed you have at least some clue as to what you
are doing.

I can get everything I need but one last question.

I am trying to implement a routine to handle the RAPIDisconnected event so I
can stop my 'synching' routine if the user disconnects the Pocket Pc during
the processing. I am struggling as to how to define the routine that traps
the RAPIDisconnected event.

Do I need to do an 'addhandler' or is there some way for me to do something
like

Private Sub DeviceDisconnected() Handles myRAPI.RAPIDisconnected

end Sub

Glyn
 
Ad

Advertisements

C

Chris Tacke, eMVP

No, there's no assumption that you know what you're doing, it's just that
everything there was done pro-bono, so often times we don't have a lot of
time, energy (and inmy case motivation) to do replete samples. For me, I
find it more interesting to extend functionality than write samples or
documentation. That's why the Communcations library is fairly extensive,
but not well documented or sampled. :)
 
C

Chris Tacke, eMVP

Oh, and I didn't answer the question...I'm guessing you have to use
AddHandler - since I rarely use VB I'm not sure though.
 
Ad

Advertisements

D

Daniel Moth

Do I need to do an 'addhandler' or is there some way for me to do
something like
Private Sub DeviceDisconnected() Handles myRAPI.RAPIDisconnected
end Sub
Yes either approach will work. Using the Handles keyword presuming you have
declared the object WithEvents OR using AddHandler/AddressOf (which is the
equivalent of += in C#)

Cheers
Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

ActiveSync 2
activesync 1
ActiveSync 1
ActiveSync 2
ActiveSync 0
ActiveSync Provider 1
ActiveSync with Emulator 3
ActiveSync with Emulator 1

Top