Compartilhar via


IVsFileChangeEx.AdviseFileChange Method

Enables a client to receive notifications of changes to a file.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function AdviseFileChange ( _
    pszMkDocument As String, _
    grfFilter As UInteger, _
    pFCE As IVsFileChangeEvents, _
    <OutAttribute> ByRef pvsCookie As UInteger _
) As Integer
int AdviseFileChange(
    string pszMkDocument,
    uint grfFilter,
    IVsFileChangeEvents pFCE,
    out uint pvsCookie
)
int AdviseFileChange(
    [InAttribute] String^ pszMkDocument, 
    [InAttribute] unsigned int grfFilter, 
    [InAttribute] IVsFileChangeEvents^ pFCE, 
    [OutAttribute] unsigned int% pvsCookie
)
abstract AdviseFileChange : 
        pszMkDocument:string * 
        grfFilter:uint32 * 
        pFCE:IVsFileChangeEvents * 
        pvsCookie:uint32 byref -> int
function AdviseFileChange(
    pszMkDocument : String, 
    grfFilter : uint, 
    pFCE : IVsFileChangeEvents, 
    pvsCookie : uint
) : int

Parameters

  • pszMkDocument
    Type: 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. This parameter can also be used to specify documents that are not files.

  • grfFilter
    Type: UInt32

    [in] Flags that indicate how the file has been changed. For more information, see _VSFILECHANGEFLAGS.

  • pvsCookie
    Type: UInt32%

    [out] Unique identifier for the file with which the event sink is associated. This value is used to unadvise the event sink using UnadviseFileChange Method.

Return Value

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

Remarks

COM Signature

From vsshell.idl:

From vsshell.idl:

HRESULT IVsFileChangeEx::AdviseFileChange(
   [in] LPCOLESTR pszMkDocument,
   [in] VSFILECHANGEFLAGS grfFilter,
   [in] IVsFileChangeEvents *pFCE,
   [out] VSCOOKIE *pvsCookie
);

.NET Framework Security

See Also

Reference

IVsFileChangeEx Interface

Microsoft.VisualStudio.Shell.Interop Namespace