Share via


COMVariant.short Method

Definition

Overloads

short()

Gets or sets the value of a COMVariant object of the VT_I2 (short) data type.

short(Int32)

short()

Gets or sets the value of a COMVariant object of the VT_I2 (short) data type.

public:
 virtual int short();
public virtual int short ();
abstract member short : unit -> int
override this.short : unit -> int
Public Overridable Function short () 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. A COMVariant object has a short data type if its data type is set to COMVariantType::VT_I2.

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

{ 
    COMVariant var = new COMVariant( 
        COMVariantInOut::IN_OUT,  
        COMVariantType::VT_I2); 
    // Set value of the object 
    var.short(123); 
}

Applies to

short(Int32)

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

Parameters

_newValue
Int32

The new value; optional.

Returns

Applies to