COMVariant.char Method

Definition

Overloads

char()

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

char(Int32)

char()

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

public:
 virtual int char();
public virtual int char ();
abstract member char : unit -> int
override this.char : unit -> int
Public Overridable Function char () 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 char data type if its data type is set to COMVariantType::VT_I1.

The following example creates a new COMVariant object of type VT_I1 and sets the value to the numeric value of A, which is 65.

{ 
    COMVariant var = new COMVariant( 
        COMVariantInOut::IN_OUT,  
        COMVariantType::VT_I1); 
    // Set value of the object 
    var.char(Char2Num("A", 1)); 
}

Applies to

char(Int32)

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

Parameters

_newValue
Int32

The new value; optional.

Returns

Applies to