IVsRunningDocumentTable.RegisterAndLockDocument 方法

,当在创建或打开文档时,在运行创建项文档表。

命名空间:  Microsoft.VisualStudio.Shell.Interop
程序集:  Microsoft.VisualStudio.Shell.Interop(在 Microsoft.VisualStudio.Shell.Interop.dll 中)

语法

声明
Function RegisterAndLockDocument ( _
    grfRDTLockType As UInteger, _
    pszMkDocument As String, _
    pHier As IVsHierarchy, _
    itemid As UInteger, _
    punkDocData As IntPtr, _
    <OutAttribute> ByRef pdwCookie As UInteger _
) As Integer
int RegisterAndLockDocument(
    uint grfRDTLockType,
    string pszMkDocument,
    IVsHierarchy pHier,
    uint itemid,
    IntPtr punkDocData,
    out uint pdwCookie
)

参数

  • grfRDTLockType
    类型:System.UInt32
    [in] 从 _VSRDTFLAGS 采用枚举的标志。标志必须包括 RDT_EditLock 或 RDT_ReadLock。
  • punkDocData
    类型:System.IntPtr
    [in] 文档的 IUnknown 接口。null 值指示未文档可持久的对象。
  • pdwCookie
    类型:System.UInt32%
    [out] 返回表示在 RDT 的抽象值文档。

返回值

类型:System.Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。

备注

COM 签名

从 vsshell.idl:

HRESULT IVsRunningDocumentTable::RegisterAndLockDocument(
   [in] VSRDTFLAGS    grfRDTLockType,
   [in] LPCOLESTR     pszMkDocument,
   [in] IVsHierarchy *pHier,
   [in] VSITEMID      itemid,
   [in] IUnknown     *punkDocData,
   [out] VSCOOKIE    *pdwCookie
);

punkDocData 参数表示要注册的文档数据对象。调用的任何包 RegisterAndLockDocument 方法创建 document 对象至少必须实现 IVsPersistDocDataIVsDocDataFileChangeControl 接口。

.NET Framework 安全性

请参见

参考

IVsRunningDocumentTable 接口

Microsoft.VisualStudio.Shell.Interop 命名空间