Share via


COMVariant.createFromInt Method

Definition

Overloads

createFromInt(Int32)

Creates a new COMVariant object and initializes it with an integer value in one operation.

createFromInt(Int32, COMVariantInOut)

createFromInt(Int32)

Creates a new COMVariant object and initializes it with an integer value in one operation.

public:
 static Dynamics::AX::Application::COMVariant ^ createFromInt(int num1);
public static Dynamics.AX.Application.COMVariant createFromInt (int num1);
static member createFromInt : int -> Dynamics.AX.Application.COMVariant
Public Shared Function createFromInt (num1 As Integer) As COMVariant

Parameters

num1
Int32

Returns

The new COMVariant object.

Remarks

The COMVariant object that is created by this method has the data type VT_I4 (integer). You can change the data type of an existing COMVariant object to VT_I4 by using the variantType method or by passing in an integer value by using the int property method.

The following example creates a COMVariant object of the VT_I4 variant data type (integer), and sets the value to 123.

{ 
    COMVariant var; 
    var = COMVariant::createFromInt(123); 
}

Applies to

createFromInt(Int32, COMVariantInOut)

public:
 static Dynamics::AX::Application::COMVariant ^ createFromInt(int _value, Dynamics::AX::Application::COMVariantInOut _inOutFlag);
public static Dynamics.AX.Application.COMVariant createFromInt (int _value, Dynamics.AX.Application.COMVariantInOut _inOutFlag);
static member createFromInt : int * Dynamics.AX.Application.COMVariantInOut -> Dynamics.AX.Application.COMVariant
Public Shared Function createFromInt (_value As Integer, _inOutFlag As COMVariantInOut) As COMVariant

Parameters

_value
Int32

A flag that determines whether the object can be used to pass data to a COM method or COM property, to receive data, or both. This parameter is optional. Possible values are:

_inOutFlag
COMVariantInOut

A flag that determines whether the object can be used to pass data to a COM method or COM property, to receive data, or both. This parameter is optional. Possible values are:

Returns

Applies to