Hi,
I have an ActiveSync service provider that needs to do only one way
sync (so its essentially a transfer), i.e., it needs to move a bunch
of files from the desktop to the device. The device side provider
implementation therefore is pretty minimal except for the
"IReplObjHandler" implementation. In fact, from "ObjectNotify" I just
return FALSE.
Now here's the issue - everytime I sync and uncradle the device all
the items I have just synced fall off ActiveSync's radar so to speak,
so that during the next sync ActiveSync does not really remember the
stuff that was synced during the previous session. This happens only
if I uncradle before I sync the second time. If I keep it connected
then it works just fine.
The reason why this happens appears to be that after cradling the
device during the second sync, ActiveSync seems to do a device-to-
desktop sync first, as a result of which "DeleteObj" gets called on
the desktop side for every single item that was synced during the
first sync. My implementation of "DeleteObj" on the desktop side does
nothing other than return S_OK. Naturally, this results in all those
items being removed from wherever it is that ActiveSync keeps that
list (repl.dat?). Just to clarify, here's the scenario which causes
the problem:
[1] Cradle device
[2] Synchronize - let's say 5 items get
transferred to the device
[4] Uncradle device
[5] Delete 2 items on the desktop
[6] Cradle device
[7] Synchronize - now ActiveSync first syncs device-to-desktop and
causes "DeleteObj" to be invoked on the desktop side for all 5 items
and then during a second automatic (i.e. ActiveSync launches another
sync immediately after the first one) sync moves the 3 items (even
though they haven't changed) from desktop to device and does nothing
about the 2 items that have been deleted.
If I understand it right, I must return TRUE from "ObjectNotify" on
the device side if and only if I intend to sync stuff back to the
desktop from the device. Is this right? I am not sure what's going
on here!
Please help! Thanks.
--
Ranju. V
http://blogorama.nerdworks.in/
--