共用方式為


IVsShell.GetProperty(Int32, Object) Method

Definition

Returns an environment property.

public:
 int GetProperty(int propid, [Runtime::InteropServices::Out] System::Object ^ % pvar);
int GetProperty(int propid, [Runtime::InteropServices::Out] winrt::Windows::Foundation::IInspectable const & & pvar);
public int GetProperty (int propid, out object pvar);
abstract member GetProperty : int * obj -> int
Public Function GetProperty (propid As Integer, ByRef pvar As Object) As Integer

Parameters

propid
Int32

[in] Identifier of the environment property. For more information, see __VSSPROPID.

pvar
Object

[out] Pointer to a VARIANT structure containing the value of the specified property.

Returns

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsShell::GetProperty(  
   [in] VSSPROPID propid,  
   [out] VARIANT *pvar  
);  

Each __VSSPROPID must return a VARIANT structure that contains the proper VT_ type. The caller can assume the VT_ is correct; that is, it is not required to call VariantChangeType or verify the type (beyond an ASSERT to be sure there were not header-file mismatches). This logic also applies to the caller when setting a property; the hierarchy will assume the caller has passed a VARIANT already converted to the proper VT_ type.

For more information, see IDispatch.

Applies to