We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

IVsHierarchy.ParseCanonicalName Method

Returns the identifier of the hierarchy item, given its canonical name.

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

int ParseCanonicalName(
	string pszName,
	out uint pitemid


Type: System.String
[in] Pointer to the canonical name of the hierarchy item.
Type: System.UInt32
[out] Pointer to the item identifier for the hierarchy item. For a list of pitemid values, see VSITEMID.

Return Value

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

Use this method to determine an item identifier (item ID), given the canonical name for an item. The canonical name is a unique name used to distinguish a particular item in the hierarchy from every other item in the hierarchy. Use the GetCanonicalName method to determine the canonical name given an item ID.

Canonical names do not change between sessions of the environment, but item identifiers do. Use this method to manage workspace persistence, such as remembering window positions.

COM Signature

From vsshell.idl:

HRESULT IVsHierarchy::ParseCanonicalName(
   [in] LPCOLESTR pszName,
   [out] VSITEMID *pitemid