แชร์ผ่าน


COMVariant.boolean Method

Definition

Overloads

boolean()

Gets or sets the value of a COMVariant object of the VT_BOOL data type.

boolean(Boolean)

boolean()

Gets or sets the value of a COMVariant object of the VT_BOOL data type.

public:
 virtual bool boolean();
public virtual bool boolean ();
abstract member boolean : unit -> bool
override this.boolean : unit -> bool
Public Overridable Function boolean () As Boolean

Returns

The current value.

Remarks

If you pass in a value that has a different data type than the object, the data type of the object will be changed to match the data type of the value. A COMVariant object has a Boolean type if its data type is set to COMVariantType::VT_BOOL. The COM Boolean data type may also be referred to as "VARIANT_BOOL".

The following example creates a new COMVariant object of type VT_BOOL and sets the value to true.

{ 
    COMVariant var = new COMVariant( 
        COMVariantInOut::IN_OUT,  
        COMVariantType::VT_BOOL); 
    // Set value of the object 
    var.boolean(true); 
}

Applies to

boolean(Boolean)

public:
 virtual bool boolean(bool _newValue);
public virtual bool boolean (bool _newValue);
abstract member boolean : bool -> bool
override this.boolean : bool -> bool
Public Overridable Function boolean (_newValue As Boolean) As Boolean

Parameters

_newValue
Boolean

The new value; optional.

Returns

Applies to