{"id":3767,"date":"2014-03-30T05:25:36","date_gmt":"2014-03-30T05:25:36","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/knowledge-about-c-sync-application-collection-of-common-programming-errors\/"},"modified":"2014-03-30T05:25:36","modified_gmt":"2014-03-30T05:25:36","slug":"knowledge-about-c-sync-application-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/knowledge-about-c-sync-application-collection-of-common-programming-errors\/","title":{"rendered":"Knowledge about C++ sync application.-Collection of common programming errors"},"content":{"rendered":"<p>You can download the help documentation from http:\/\/www.microsoft.com\/downloads\/details.aspx?familyid=a3ee7bc5-a823-4fb4-b152-9e8ce9d5546f&amp;displaylang=en<\/p>\n<p>The documentation has detailed steps and examples\u00a0about how to create a native sync provider and how to create sync application.<\/p>\n<p>here is a copy of the sample code from the documentation to start a sync between 2 providers.<\/p>\n<pre>HRESULT Synchronize(ISyncProvider* pProvSrc, ISyncProvider* pProvDest)\n{\n    HRESULT hr = E_UNEXPECTED;\n\n    IApplicationSyncServices* pSvc = NULL;\n    hr = CoCreateInstance(CLSID_SyncServices, NULL, CLSCTX_INPROC_SERVER, \n        IID_IApplicationSyncServices, (void**)&amp;pSvc);\n    if (SUCCEEDED(hr))\n    {\n        ISyncSession* pSession = NULL;\n        hr = pSvc-&gt;CreateSyncSession(pProvDest, pProvSrc, &amp;pSession);\n        if (SUCCEEDED(hr))\n        {\n            SYNC_SESSION_STATISTICS syncStats;\n            \/\/ Arbitrarily choose \"destination wins\" conflict resolution\n            hr = pSession-&gt;Start(CRP_DESTINATION_PROVIDER_WINS, &amp;syncStats);\n            if (SUCCEEDED(hr))\n            {\n                \/\/ Display the session statistics to the user.\n                CString strMsg;\n                strMsg.Format(L\"%d changes succeeded.\\n%d changes failed.\", syncStats.dwChangesApplied,\n                    syncStats.dwChangesFailed);\n                MessageBox(NULL, strMsg.GetString(), L\"Synchronization Statistics\", MB_ICONINFORMATION);\n            }\n\n            pSession-&gt;Release();\n        }\n\n        pSvc-&gt;Release();\n    }\n\n    return hr;\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You can download the help documentation from http:\/\/www.microsoft.com\/downloads\/details.aspx?familyid=a3ee7bc5-a823-4fb4-b152-9e8ce9d5546f&amp;displaylang=en The documentation has detailed steps and examples\u00a0about 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 = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3767","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3767"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3767\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}