IVsFileChangeEx.SyncFile(String) Method

Definition

Forces change events to be sent. Used in conjunction with IgnoreFile(UInt32, String, Int32) to make file changes but not receive notification.

public:
 int SyncFile(System::String ^ pszMkDocument);
public:
 int SyncFile(Platform::String ^ pszMkDocument);
int SyncFile(std::wstring const & pszMkDocument);
public int SyncFile (string pszMkDocument);
abstract member SyncFile : string -> int
Public Function SyncFile (pszMkDocument As String) As Integer

Parameters

pszMkDocument
String

[in] String form of the moniker identifier of the document in the project system. In the case of documents that are files, this is always the path to the file.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsFileChangeEx::SyncFile(  
   [in] LPCOLESTR pszMkDocument  
);  

Use this method in conjunction with IgnoreFile Method if you are making a change to the file and do not want to receive the change notification. This is shown in the following example:

pFC->IgnoreFile(dwConnect, "MyFile.cpp", TRUE);  
SaveFile("MyFile.cpp");  
pFC->SyncFile("MyFile.cpp")  
// Forces the change events to be sent. This ensures the event will not be sent (asynchronously) to you after you stop ignoring the file.  
pFC->IgnoreFile(dwConnect, "MyFile.cpp", FALSE)  
// This indicates you are listening to the events again.  

Applies to