locked
Sync for Unmanaged (C++) application RRS feed

  • Question

  • Are there any samples for writing c++ sync providers ?
    Friday, May 18, 2012 1:56 PM

All replies

    • Edited by JuneT Monday, May 21, 2012 12:07 PM
    Monday, May 21, 2012 7:27 AM
  • Thanks. Not sure if the first link will help, I need to create providers, not producers. We've got a c# application that uses the Sync Framework to synchronize a SQL Compact DB (local) with a SQL Server DB (web). We want to take that functionality out of the application and make it a DLL/service running on the PC. The PC has limited resources (memory) and we're trying to imporve performance.

    The second link does not work.

    Steve

    Monday, May 21, 2012 12:01 PM
  • i fixed the second link...

    which providers are you using for your current sync implementation? offhand, im not sure how much improvement you'll get rewriting in C++ what is already available OOTB.

    Monday, May 21, 2012 12:09 PM
  • Well, this is really turning sour. I've tried compiling and running some of the very basic File Sync samples.......they ALL fail on the CoCreateInstance.......

    http://msdn.microsoft.com/en-us/library/cc305401

    Also tried the sample that are in

    C:\Program Files (x86)\Microsoft SDKs\Microsoft Sync Framework\v1.0\Samples

    Same thing......CoCreateInstance file with CLASS_NOT_REGISTERED.

    Not sure if is a 32/64 problem? I'm running the 64 bit Win7, but compiling for 32-bit app. When I look in the registry, the InProcServer32 CLSID specifies the 64bit DLL, but I'm linked against the 32bit libraries in C:\Program Files (x86)\Microsoft SDKs\Microsoft Sync Framework\v1.0\lib\x86. If I try to link to the x64 libraries, I get a link error, unresolved external symbol for CLSIC_FileSyncProvider.

    Monday, May 21, 2012 2:25 PM
  • that error is normally related to the 32/64 matching as you mentioned...for managed code, normally, the target platform of the application should match the platform of the sync framework installed

    Monday, May 21, 2012 3:01 PM
  • Yep, thats what is was. I uninstalled all the syncframework, and just installed the 32-bit. Now I'm stuck here....

    To synchronize all files and subfolders in a directory, pass the replica ID and root directory to IFileSyncProvider::Initialize, pass the provider to IApplicationSyncServices::CreateSyncSession, and use the returned ISyncSession object to handle the synchronization session.

    What do I use for Replica ID???

    I am using

    REFGUID srcGuiId = DBGUID_DEFAULT; Problem is, when I call the pSession->Start, it is returning

    SYNC_E_METADATA_REPLICA_IN_USE

    Monday, May 21, 2012 6:18 PM