IVsAppCommandLine.GetOption(String, Int32, String) Method

Definition

Retrieves the command line switches.

public:
 int GetOption(System::String ^ pszOptionName, [Runtime::InteropServices::Out] int % pfPresent, [Runtime::InteropServices::Out] System::String ^ % pbstrOptionValue);
int GetOption(std::wstring const & pszOptionName, [Runtime::InteropServices::Out] int & pfPresent, [Runtime::InteropServices::Out] std::wstring const & & pbstrOptionValue);
public int GetOption (string pszOptionName, out int pfPresent, out string pbstrOptionValue);
abstract member GetOption : string * int * string -> int
Public Function GetOption (pszOptionName As String, ByRef pfPresent As Integer, ByRef pbstrOptionValue As String) As Integer

Parameters

pszOptionName
String

[in] Command line switch name.

pfPresent
Int32

[out] Flag indicating if user entered command line switch pszOptionName.

pbstrOptionValue
String

[out] BSTR containing text the user entered as a parameter of the command line switch.

Returns

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsAppCommandLine::GetOption(  
   [in] LPCOLESTR pszOptionName,  
   [out] BOOL* pfPresent,  
   [out, retval] BSTR* pbstrOptionValue  
);  

Call this method from SetSite Method each time your package is loaded. Examine pfPresent to determine if your command line switch was entered. Examine pbstrOptionValue to retrieve any text that was entered if your command line switch accepts arguments. For more information on implementing command line switches, see Adding Command Line Switches.

Applies to