IVsExpansionManager.GetTokenPath(UInt32, String) Method

Definition

Returns the path to the specified location.

public:
 int GetTokenPath(System::UInt32 token, [Runtime::InteropServices::Out] System::String ^ % pbstrPath);
int GetTokenPath(unsigned int token, [Runtime::InteropServices::Out] std::wstring const & & pbstrPath);
public int GetTokenPath (uint token, out string pbstrPath);
abstract member GetTokenPath : uint32 * string -> int
Public Function GetTokenPath (token As UInteger, ByRef pbstrPath As String) As Integer

Parameters

token
UInt32

[in] A value from the _ExpansionToken enumeration.

pbstrPath
String

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

Returns

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

Remarks

COM Signature

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#".

Applies to