Knowledge about C++ sync application.-Collection of common programming errors

You can download the help documentation from http://www.microsoft.com/downloads/details.aspx?familyid=a3ee7bc5-a823-4fb4-b152-9e8ce9d5546f&displaylang=en

The documentation has detailed steps and examples about how to create a native sync provider and how to create sync application.

here is a copy of the sample code from the documentation to start a sync between 2 providers.

HRESULT Synchronize(ISyncProvider* pProvSrc, ISyncProvider* pProvDest)
{
    HRESULT hr = E_UNEXPECTED;

    IApplicationSyncServices* pSvc = NULL;
    hr = CoCreateInstance(CLSID_SyncServices, NULL, CLSCTX_INPROC_SERVER, 
        IID_IApplicationSyncServices, (void**)&pSvc);
    if (SUCCEEDED(hr))
    {
        ISyncSession* pSession = NULL;
        hr = pSvc->CreateSyncSession(pProvDest, pProvSrc, &pSession);
        if (SUCCEEDED(hr))
        {
            SYNC_SESSION_STATISTICS syncStats;
            // Arbitrarily choose "destination wins" conflict resolution
            hr = pSession->Start(CRP_DESTINATION_PROVIDER_WINS, &syncStats);
            if (SUCCEEDED(hr))
            {
                // Display the session statistics to the user.
                CString strMsg;
                strMsg.Format(L"%d changes succeeded.\n%d changes failed.", syncStats.dwChangesApplied,
                    syncStats.dwChangesFailed);
                MessageBox(NULL, strMsg.GetString(), L"Synchronization Statistics", MB_ICONINFORMATION);
            }

            pSession->Release();
        }

        pSvc->Release();
    }

    return hr;
}