IVsRunningDocumentTable.RenameDocument(String, String, IntPtr, UInt32) Method

Definition

Renames and/or changes the ownership of a document.

public:
 int RenameDocument(System::String ^ pszMkDocumentOld, System::String ^ pszMkDocumentNew, IntPtr pHier, System::UInt32 itemidNew);
public int RenameDocument (string pszMkDocumentOld, string pszMkDocumentNew, IntPtr pHier, uint itemidNew);
abstract member RenameDocument : string * string * nativeint * uint32 -> int
Public Function RenameDocument (pszMkDocumentOld As String, pszMkDocumentNew As String, pHier As IntPtr, itemidNew As UInteger) As Integer

Parameters

pszMkDocumentOld
String

[in] Path to the previous document.

pszMkDocumentNew
String

[in] Path to the current document.

pHier
IntPtr

nativeint

[in] The IVsHierarchy interface that is to take ownership. Use HIERARCHY_DONTCHANGE if not changing ownership.

itemidNew
UInt32

[in] Item identifier of the current document if the hierarchy is to take ownership. This is a unique identifier or it can be one of the following values: VSITEMID_NIL, VSITEMID_ROOT, or VSITEMID_SELECTION. Use VSITEMID_NIL if not changing ownership.

Returns

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsRunningDocumentTable::RenameDocument(  
   [in] LPCOLESTR     pszMkDocumentOld,  
   [in] LPCOLESTR     pszMkDocumentNew,  
   [in] IVsHierarchy *pHier,  
   [in] VSITEMID      itemidNew  
);  

The project should call this method to transfer ownership of the document to its hierarchy and give the document a new itemid within the project.

Applies to