none
Unmanaged samples RRS feed

  • Question

  • I haven't been able to find much in terms of samples of Unmanaged code for the sync framework.

    I do have my sync process working fine through managed c# code.  Now i'd like to be able to access the metadata store through unmanaged c++ code.  I have been able to open the metadata store...but need some help iterating through the values in the store.  I can do this on the C# side through SimpleSyncServices.EnumerateAllLiveItems  

    I know i'm supposed to use the ISimplesyncServices interface, but not sure how to go about it...I'm new to Com programming....do I use CoCreateInstance to get to that interface?  What would i use for the first parameter for that function....it should be the com object that exposes that interface...

    this is what i have so far...

    hr = CoCreateInstance(CLSID_SyncMetadataStore, NULL, CLSCTX_INPROC_SERVER, IID_ISqlSyncMetadataStore, 
            (void **) &m_pSqlMetadataStore);
        if (SUCCEEDED(hr))
        {
    hr = m_pSqlMetadataStore->OpenStore(L"c:\\path to store", 0x409);
    if (HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) == hr)
            {
    int j =0;
    }
    }
    Wednesday, December 19, 2012 11:25 PM

All replies

  • Ok..i have gone a bit further in trying to read the metadata outside of the sync process.

    I am able to open the store, but when i go to get the metadata through

    hr= m_pSqlMetadataStore->GetReplicaMetadata((BYTE *)&guid, &m_IdParams, &m_pReplicaMetadata);

    I'm getting  SYNC_E_METADATA_REPLICA_NOT_FOUND
    I'm using the same guid in this call as I did in the managed sync code that created the metadata store. I have confirmed this by browsing the tables in the SQL CE database.

    I'm creating the GUID as follows

    GUID guid;

    hr = CLSIDFromString(L

    "{E7290R82-2E1A-12e4-BC97-4D1969999184}", (LPCLSID)&guid);

     

      


    Friday, December 21, 2012 12:01 AM