Partager via


COMVariant.int Method

Definition

Overloads

int()

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

int(Int32)

int()

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

public:
 virtual int int();
public virtual int int ();
abstract member int : unit -> int
override this.int : unit -> int
Public Overridable Function int () As Integer

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. The COMVariantType::VT_I4 data type is also used for the long variant type. The COMVariant.long method is identical to this method; the two methods exist for completeness.

The following example creates a COMVariant object of type VT_I4 and sets the value to 123456.

{ 
    COMVariant var = new COMVariant( 
        COMVariantInOut::IN_OUT,  
        COMVariantType::VT_I4); 
    // Set value of the object 
    var.int(123456); 
}

Applies to

int(Int32)

public:
 virtual int int(int _newValue);
public virtual int int (int _newValue);
abstract member int : int -> int
override this.int : int -> int
Public Overridable Function int (_newValue As Integer) As Integer

Parameters

_newValue
Int32

The new value; optional.

Returns

Applies to