ISyncMgrSyncCallback::CommitItem method
Confirms a specified item as a member of the handler's sync set and confirms that it should be shown in the UI.
Syntax
HRESULT CommitItem(
[in] LPCWSTR *pszItemID
);
Parameters
- pszItemID [in]
-
Type: LPCWSTR*
A pointer to a buffer containing the unique ID of the item to confirm. This string is of maximum length MAX_SYNCMGR_ID including the terminating null character.
Return value
Type: HRESULT
Returns S_OK if successful, or an error value otherwise. Returns E_INVALIDARG if the item has not been first submitted through ISyncMgrSyncCallback::ProposeItem or if the item is already part of the current session.
Examples
The following example shows the usage of ISyncMgrSyncCallback::CommitItem by the Synchronize method.
HRESULT CMyDeviceHandler::Synchronize(...)
{
...
// Start synchronizing the handler.
...
// Find items waiting to be created.
for (...)
{
// Create the item.
ISyncMgrSyncItem *pNewItem = NULL;
LPWSTR szItemID[MAX_SYNCMGR_ID];
hr = GetNextNewItem(&pNewItem, szItemID, ARRAYSIZE(szItemID));
if (SUCCEEDED(hr))
{
// Propose this item to Sync Center.
hr = pCallback->ProposeItem(pNewItem);
if (SUCCEEDED(hr))
{
// Synchronize the item.
// Synchronization was successful. Commit the item.
hr = pCallback->CommitItem(szItemID);
}
pNewItem->Release();
}
}
...
}
Requirements
|
Minimum supported client |
Windows Vista [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2008 [desktop apps only] |
|
Header |
|
|
IDL |
|