共用方式為


IVsShell.GetProperty Method

Returns an environment property.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function GetProperty ( _
    propid As Integer, _
    <OutAttribute> ByRef pvar As Object _
) As Integer
int GetProperty(
    int propid,
    out Object pvar
)
int GetProperty(
    [InAttribute] int propid, 
    [OutAttribute] Object^% pvar
)
abstract GetProperty : 
        propid:int * 
        pvar:Object byref -> int
function GetProperty(
    propid : int, 
    pvar : Object
) : int

Parameters

  • propid
    Type: Int32

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

  • pvar
    Type: Object%

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

Return Value

Type: Int32
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.

.NET Framework Security

See Also

Reference

IVsShell Interface

Microsoft.VisualStudio.Shell.Interop Namespace