IVsExpansionManager::GetTokenPath Method (UInt32, String^)

 

Returns the path to the specified location.

Namespace:   Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop.8.0 (in Microsoft.VisualStudio.TextManager.Interop.8.0.dll)

int GetTokenPath(
	unsigned int token,
	[OutAttribute] String^% pbstrPath
)

Parameters

token
Type: System::UInt32

[in] A value from the _ExpansionToken enumeration.

pbstrPath
Type: System::String^

[out] Returns a string containing the full path to the specified location.

Return Value

Type: System::Int32

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

From textmgr2.idl:

HRESULT IVsExpansionManager::GetTokenPath(
   [in]ExpansionToken,
   [out] BSTR *pbstrPath
);

Snippets are typically stored in several locations including the location where the associated language service is installed or a folder in the user's My Documents folder. Snippets can also be associated with a specific project or project item and stored in a folder relative to that project or project item.

The paths returned from this method are not to the snippets folder but to the base folder. For example, specifying a token value of ET_MyDocs may return a path such as "C:\Documents and Settings\[username]\My Documents\Visual Studio 2005". The snippets are stored under that path in "Code Snippets\[languagename]\My Code Snippets", where [languageName] is the name of the language such as "C#".

Return to top
Show: