IVsRunningDocumentTable::RenameDocument Method (String^, String^, IntPtr, UInt32)

 

Renames and/or changes the ownership of a document.

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

int RenameDocument(
	String^ pszMkDocumentOld,
	String^ pszMkDocumentNew,
	IntPtr pHier,
	unsigned int itemidNew
)

Parameters

pszMkDocumentOld
Type: System::String^

[in] Path to the previous document.

pszMkDocumentNew
Type: System::String^

[in] Path to the current document.

pHier
Type: System::IntPtr

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

itemidNew
Type: System::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.

Return Value

Type: System::Int32

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

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.

Return to top
Show: