IVsAppCommandLine.GetOption(String, Int32, String) 方法

定义

检索命令行开关。

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

参数

pszOptionName
String

中命令行开关名称。

pfPresent
Int32

弄一个标志,用于指示用户是否输入了命令行开关 pszOptionName

pbstrOptionValue
String

弄包含用户作为命令行开关的参数输入的文本的 BSTR。

返回

Int32

如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。

注解

COM 签名

从 vsshell:

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

SetSite每次加载包时,从方法调用此方法。 检查 pfPresent 以确定是否输入了命令行开关。 pbstrOptionValue如果命令行开关接受参数,请检查以检索输入的任何文本。 有关实现命令行开关的详细信息,请参阅 Adding Command Line Switches

适用于