ISimilarity::CopyAndSwap method

Creates copies of an existing similarity traits table and an existing similarity file ID table, swaps the internal pointers, and deletes the existing tables.

After the CopyAndSwap method returns, the application continues to use the same ISimilarity object that it used before calling this method. However, the ISimilarity object is now associated with a different similarity file on disk.


HRESULT CopyAndSwap(
  ISimilarity               *newSimilarityTables,
  ISimilarityReportProgress *reportProgress



An optional pointer to a temporary ISimilarity object that is used to create temporary copies of the tables. Before calling the CopyAndSwap method, the caller must call the CreateTable method to create the temporary tables. On return, the caller must call the CloseTable method to close the temporary tables.


An optional pointer to an ISimilarityReportProgress object that will receive information on the progress of the copy-and-swap operation and allow the application to stop the copy operation. The caller must release this interface when it is no longer needed.

Return Value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


Windows version Windows Vista Windows Server 2008
Target Platform Windows
Header msrdc.h
DLL MsRdc.dll

See Also