Variant

A Variant is a generic OLE mechanism for passing data of different types via a common interface.

<p>It is used within the OleAutomation object for getting a property, setting a property or invoking a method on an OLE Control or OLE Document.

Constructors

this
this()

Create an empty Variant object with type VT_EMPTY.

this
this(float val)

Create a Variant object which represents a Java float as a VT_R4.

this
this(double val)

Create a Variant object which represents a Java double as a VT_R8.

this
this(int val)

Create a Variant object which represents a Java int as a VT_I4.

this
this(void* ptr, ushort byRefType)

Create a Variant object which contains a reference to the data being transferred.

this
this(OleAutomation automation)

Create a Variant object which represents an IDispatch interface as a VT_Dispatch.

this
this(IDispatch idispatch)

Create a Variant object which represents an IDispatch interface as a VT_Dispatch. <p>The caller is expected to have appropriately invoked unknown.AddRef() before creating this Variant.

this
this(IUnknown unknown)

Create a Variant object which represents an IUnknown interface as a VT_UNKNOWN.

this
this(long val)

Create a Variant object which represents a Java long as a VT_I8.

this
this(String string)

Create a Variant object which represents a Java String as a VT_BSTR.

this
this(short val)

Create a Variant object which represents a Java short as a VT_I2.

this
this(bool val)

Create a Variant object which represents a Java bool as a VT_BOOL.

Members

Functions

dispose
void dispose()

Calling dispose will release resources associated with this Variant. If the resource is an IDispatch or IUnknown interface, Release will be called. If the resource is a ByRef pointer, nothing is released.

getAutomation
OleAutomation getAutomation()

Returns the OleAutomation object represented by this Variant.

getBoolean
bool getBoolean()

Returns the Java bool represented by this Variant.

getByRef
void* getByRef()

Returns a pointer to the referenced data represented by this Variant.

getByte
byte getByte()

Returns the Java byte represented by this Variant.

getChar
wchar getChar()

Returns the Java char represented by this Variant.

getDispatch
IDispatch getDispatch()

Returns the IDispatch object represented by this Variant.

getDouble
double getDouble()

Returns the Java double represented by this Variant.

getFloat
float getFloat()

Returns the Java float represented by this Variant.

getInt
int getInt()

Returns the Java int represented by this Variant.

getLong
long getLong()

Returns the Java long represented by this Variant.

getShort
short getShort()

Returns the Java short represented by this Variant.

getString
String getString()

Returns the Java String represented by this Variant.

getType
short getType()

Returns the type of the variant type. This will be an OLE.VT_* value or a bitwise combination of OLE.VT_* values as in the case of OLE.VT_BSTR | OLE.VT_BYREF.

getUnknown
IUnknown getUnknown()

Returns the IUnknown object represented by this Variant.

setByRef
void setByRef(bool val)

Update the by reference value of this variant with a new bool value.

setByRef
void setByRef(float val)

Update the by reference value of this variant with a new float value.

setByRef
void setByRef(int val)

Update the by reference value of this variant with a new integer value.

setByRef
void setByRef(short val)

Update the by reference value of this variant with a new short value.

toString
String toString()

Returns a string containing a concise, human-readable description of the receiver.

Static functions

win32_copy
void win32_copy(VARIANT* pVarDest, Variant varSrc)

Invokes platform specific functionality to copy a variant into operating system memory. <p> <b>IMPORTANT:</b> This method is <em>not</em> part of the public API for <code>Variant</code>. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code. </p>

win32_new
Variant win32_new(VARIANT* pVariant)

Invokes platform specific functionality to wrap a variant that was allocated in operating system memory. <p> <b>IMPORTANT:</b> This method is <em>not</em> part of the public API for <code>Variant</code>. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code. </p>

Meta