Partilhar via


COMVariant.createFromStr Method

Definition

Overloads

createFromStr(String, COMVariantInOut)
createFromStr(String)

Creates a new COMVariant object and initializes it with a string in one operation.

createFromStr(String, COMVariantInOut)

public:
 static Dynamics::AX::Application::COMVariant ^ createFromStr(System::String ^ _value, Dynamics::AX::Application::COMVariantInOut _inOutFlag);
public static Dynamics.AX.Application.COMVariant createFromStr (string _value, Dynamics.AX.Application.COMVariantInOut _inOutFlag);
static member createFromStr : string * Dynamics.AX.Application.COMVariantInOut -> Dynamics.AX.Application.COMVariant
Public Shared Function createFromStr (_value As String, _inOutFlag As COMVariantInOut) As COMVariant

Parameters

_value
String

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

createFromStr(String)

Creates a new COMVariant object and initializes it with a string in one operation.

public:
 static Dynamics::AX::Application::COMVariant ^ createFromStr(System::String ^ text1);
public static Dynamics.AX.Application.COMVariant createFromStr (string text1);
static member createFromStr : string -> Dynamics.AX.Application.COMVariant
Public Shared Function createFromStr (text1 As String) As COMVariant

Parameters

text1
String

Returns

The new COMVariant object.

Remarks

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

The following example creates a COMVariant object of the VT_BSTR variant data type and sets the value to "Hello World."

{ 
    COMVariant var; 
    var = COMVariant::createFromStr("Hello World"); 
}

Applies to