COMVariant.long Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
long() |
Gets or sets the value of a COMVariant object of the VT_I4 data type. |
long(Int32) |
long()
Gets or sets the value of a COMVariant object of the VT_I4 data type.
public:
virtual int long();
public virtual int long ();
abstract member long : unit -> int
override this.long : unit -> int
Public Overridable Function long () 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. The COMVariantType::VT_I4 data type is also used for the int variant type. The COMVariant.int method is identical to this method; the two methods exist for completeness.
The following example creates a COMVariant object of type VT_I4 and sets the value to 123456.
{
COMVariant var = new COMVariant(
COMVariantInOut::IN_OUT,
COMVariantType::VT_I4);
// Set value of the object
var.long(123456);
}