Partager via


COMVariant.byte Method

Definition

Overloads

byte(Int32)
byte()

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

byte(Int32)

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

Parameters

_newValue
Int32

The new value; optional.

Returns

Applies to

byte()

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

public:
 virtual int byte();
public virtual int byte ();
abstract member byte : unit -> int
override this.byte : unit -> int
Public Overridable Function byte () 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 byte data type if its data type is set to COMVariantType::VT_UI1. You can also use "unsigned char" to refer to the COM byte data type.

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

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

Applies to