The files Oleaut32.dll (for 32-bit systems) and Ole2disp.dll (for 16-bit systems) provide the following low-level functions for converting variant data types. Higher-level variant manipulation functions (such as VariantChangeType) use these functions, but they can also be called directly.
Convert to type |
From type |
Function |
unsigned char |
unsigned char |
None |
|
short |
VarUI1FromI2(sIn, pbOut) |
|
long |
VarUI1FromI4(lIn, pbOut) |
|
float |
VarUI1FromR4(fltIn, pbOut) |
|
double |
VarUI1FromR8(dblIn, pbOut) |
|
CURRENCY |
VarUI1FromCy(cyIn, pbOut) |
|
DATE |
VarUI1FromDate(dateIn, pbOut) |
|
OLECHAR FAR* |
VarUI1FromStr(strIn, lcid, dwFlags, pbOut) |
|
IDispatch FAR* |
VarUI1FromDisp(pdispIn, lcid, pbOut) |
|
BOOL |
VarUI1FromBool(boolIn, pbOut) |
short |
unsigned char |
VarI2FromUI1(bIn, psOut) |
|
short |
None |
|
long |
VarI2FromI4(lIn, psOut) |
|
float |
VarI2FromR4(fltIn, psOut) |
|
double |
VarI2FromR8(dblIn, psOut) |
|
CURRENCY |
VarI2FromCy(cyIn, psOut) |
|
DATE |
VarI2FromDate(dateIn, psOut) |
|
OLECHAR FAR* |
VarI2FromStr(strIn, lcid, dwFlags, psOut) |
|
IDispatch FAR* |
VarI2FromDisp(pdispIn, lcid, psOut) |
|
BOOL |
VarI2FromBool(boolIn, psOut) |
long |
unsigned char |
VarI4FromUI1(bIn, plOut) |
|
short |
VarI4FromI2(sIn, plOut) |
|
long |
None |
|
float |
VarI4FromR4(fltIn, plOut) |
|
double |
VarI4FromR8(dblIn, plOut) |
|
CURRENCY |
VarI4FromCy(cyIn, plOut) |
|
DATE |
VarI4FromDate(dateIn, plOut) |
|
OLECHAR FAR* |
VarI4FromStr(strIn, lcid, dwFlags, plOut) |
|
IDispatch FAR* |
VarI4FromDisp(pdispIn, lcid, plOut) |
|
BOOL |
VarI4FromBool(boolIn, plOut) |
float |
unsigned char |
VarR4FromUI1(bIn, pfltOut) |
|
short |
VarR4FromI2(sIn, pfltOut) |
|
long |
VarR4FromI4(lIn, pfltOut) |
|
float |
None |
|
double |
VarR4FromR8(dblIn, pfltOut) |
|
CURRENCY |
VarR4FromCy(cyIn, pfltOut) |
|
DATE |
VarR4FromDate(dateIn, pfltOut) |
|
OLECHAR FAR* |
VarR4FromStr(strIn, lcid, dwFlags, pfltOut) |
|
IDispatch FAR* |
VarR4FromDisp(pdispIn, lcid, pfltOut) |
|
BOOL |
VarR4FromBool(boolIn, pfltOut) |
double |
unsigned char |
VarR8FromUI1(bIn, pdblOut) |
|
short |
VarR8FromI2(sIn, pdblOut) |
|
long |
VarR8FromI4(lIn, pdblOut) |
|
float |
VarR8FromR4(fltIn, pdblOut) |
|
double |
None |
|
CURRENCY |
VarR8FromCy(cyIn, pdblOut) |
|
DATE |
VarR8FromDate(dateIn, pdblOut) |
|
OLECHAR FAR* |
VarR8FromStr(strIn, lcid, dwFlags, pdblOut) |
|
IDispatch FAR* |
VarR8FromDisp(pdispIn, lcid, pdblOut) |
|
BOOL |
VarR8FromBool(boolIn, pdblOut) |
DATE |
unsigned char |
VarDateFromUI1(bIn, pdateOut) |
|
short |
VarDateFromI2(sIn, pdateOut) |
|
long |
VarDateFromI4(lIn, pdateOut) |
|
float |
VarDateFromR4(fltIn, pdateOut) |
|
double |
VarDateFromR8(dblIn, pdateOut) |
|
CURRENCY |
VarDateFromCy(cyIn, pdateOut) |
|
DATE |
None |
|
OLECHAR FAR* |
VarDateFromStr(strIn, lcid, dwFlags, pdateOut) |
|
IDispatch FAR* |
VarDateFromDisp(pdispIn, lcid, pdateOut) |
|
BOOL |
VarDateFromBool(boolIn, pdateOut) |
CURRENCY |
unsigned char |
VarCyFromUI1(bIn, pcyOut) |
|
short |
VarCyFromI2(sIn, pcyOut) |
|
long |
VarCyFromI4(lIn, pcyOut) |
|
float |
VarCyFromR4(fltIn, pcyOut) |
|
double |
VarCyFromR8(dblIn, pcyOut) |
|
CURRENCY |
None |
|
DATE |
VarCyFromDate(dateIn, pcyOut) |
|
OLECHAR FAR* |
VarCyFromStr(strIn, lcid, dwFlags, pcyOut) |
|
IDispatch FAR* |
VarCyFromDisp(pdispIn, lcid, pcyOut) |
|
BOOL |
VarCyFromBool(boolIn, pcyOut) |
BSTR |
unsigned char |
VarBstrFromUI1(bVal, lcid, dwFlags, pbstrOut) |
|
short |
VarBstrFromI2(iVal, lcid, dwFlags, pbstrOut) |
|
long |
VarBstrFromI4(lIn, lcid, dwFlags, pbstrOut) |
|
float |
VarBstrFromR4(fltIn, lcid, dwFlags, pbstrOut) |
|
double |
VarBstrFromR8(dblIn, lcid, dwFlags, pbstrOut) |
|
CURRENCY |
VarBstrFromCy(cyIn, lcid, dwFlags, pbstrOut) |
|
DATE |
VarBstrFromDate(dateIn, lcid, dwFlags, pbstrOut) |
|
OLECHAR FAR* |
None |
|
IDispatch FAR* |
VarBstrFromDisp(pdispIn, lcid, dwFlags, pbstrOut) |
|
BOOL |
VarBstrFromBool(boolIn, lcid, dwFlags, pbstrOut) |
BOOL |
unsigned char |
VarBoolFromUI1(bIn, pboolOut) |
|
short |
VarBoolFromI2(sIn, pboolOut) |
|
long |
VarBoolFromI4(lIn, pboolOut) |
|
float |
VarBoolFromR4(fltIn, pboolOut) |
|
double |
VarBoolFromR8(dblIn, pboolOut) |
|
CURRENCY |
VarBoolFromCy(cyIn, pboolOut) |
|
DATE |
VarBoolFromDate(dateIn, pboolOut) |
|
OLECHAR FAR* |
VarBoolFromStr(strIn, lcid, dwFlags, pboolOut) |
|
IDispatch FAR* |
VarBoolFromDisp(pdispIn, lcid, pboolOut) |
|
BOOL |
None |
The return value obtained from the returned HRESULT is one of the following.