Synchronizing Files

  • Thread starter Thread starter Joe Audette
  • Start date Start date
J

Joe Audette

I need to synchronize text files between the PocketPC and
desktop. I've been researching how to implement an
ActiveSync service provider but all the examples seem to
be in C++. I'm wondering if its possible to implement
using VB 6. Anyone out there done that sort of thing? Any
sample code to get me started? Is C++ the only way to do
it?

I need to convert the format of the files too. On the
PocketPC the files are xml while the desktop uses plain
text with entries written on each line.

Thanks,

Joe Audette
 
Joe,

C++ is what you need to write an ActiveSync service provider. Have you
considered writing a Rapi app instead? There is a Rapi class on
www.opennetcf.org in the Communication section that can get you started, and
you can use VB.Net or C# to write it. Rapi allows you to control and copy
files on the PocketPC from a desktop app, and you could also convert the
PocketPC xml files to text in the same app.
 
Ginny,

Thanks for the response. I've seen that on opencf.org and
was wondering whether that might be an option. Would the
code run on the device or on the desktop? Would/could it
synchronize when you dock it?

The desktop app is not aware of the PocketPC app. The
desktop app just stores its saved info in text files with
a particular naming scheme. Could I do it all from the
PocketPC? Just read the text files from the desktop,
convert to the xml format for the PocketPC then write
text files to the folder on the desktop? It would be nice
if I can do it all from the device.

Thanks Again,

Joe Audette
 
Joe,

The code would run on the desktop, and you could either make the desktop app
(written as a service) wake up when the ActiveSync connection occurs, or you
could ask the user to press a key when the device is cradled and ready for
syncing.
 
That won't work for me because I don't want the .NET
framework on the desktop to be a requirement for the app.
If there was a way to do it from the device it would be
great. I guess I'll have to save the sync feature for
version 2 and start learning C++

Thanks Again for your help,

Joe
 
Joe,

You don't have to use .Net to use Rapi. It's just an API that's fairly easy
to use so you could write the desktop app in any language that can make API
calls. The OpenNetCF code is just a wrapper around the API and illustrates
how to use it, but there are other examples too. Chris Muench has a whole
chapter about Rapi in his book (The Windows CE TEchnology Tutorial). Doug
Boling also covers Rapi in his book (Programming Windows CE). Both these
have examples in C++, but you aren't limited to C++ or a .Net language for
Rapi programming.
 
Joe,

Are you aware that ActiveSync can do this by itself using its file
synchronisation features? There is a restrictioin that the files to be
synced must be in a sub-folder of My Documents but if this is a problem
there is a little program called MightySync that sits on top of ActiveSync
and allows any folder to be synchronised.

John.
 
Back
Top