Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #if !defined(_OLEAUTO_H_)
      7 #define _OLEAUTO_H_
      8 
      9 #ifndef RC_INVOKED
     10 #include <pshpack8.h>
     11 #endif
     12 
     13 #ifdef _OLEAUT32_
     14 #define WINOLEAUTAPI STDAPI
     15 #define WINOLEAUTAPI_(type) STDAPI_(type)
     16 #else
     17 #define WINOLEAUTAPI EXTERN_C DECLSPEC_IMPORT HRESULT WINAPI
     18 #define WINOLEAUTAPI_(type) EXTERN_C DECLSPEC_IMPORT type WINAPI
     19 #endif
     20 
     21 EXTERN_C const IID IID_StdOle;
     22 
     23 #define STDOLE_MAJORVERNUM 0x1
     24 #define STDOLE_MINORVERNUM 0x0
     25 #define STDOLE_LCID 0x0000
     26 
     27 #define STDOLE2_MAJORVERNUM 0x2
     28 #define STDOLE2_MINORVERNUM 0x0
     29 #define STDOLE2_LCID 0x0000
     30 
     31 #ifndef _LCID_DEFINED
     32 typedef DWORD LCID;
     33 #define _LCID_DEFINED
     34 #endif
     35 
     36 #ifndef BEGIN_INTERFACE
     37 #define BEGIN_INTERFACE
     38 #define END_INTERFACE
     39 #endif
     40 
     41 #include <oaidl.h>
     42 
     43 WINOLEAUTAPI_(BSTR) SysAllocString(const OLECHAR *);
     44 WINOLEAUTAPI_(INT) SysReAllocString(BSTR *,const OLECHAR *);
     45 WINOLEAUTAPI_(BSTR) SysAllocStringLen(const OLECHAR *,UINT);
     46 WINOLEAUTAPI_(INT) SysReAllocStringLen(BSTR *,const OLECHAR *,UINT);
     47 WINOLEAUTAPI_(void) SysFreeString(BSTR);
     48 WINOLEAUTAPI_(UINT) SysStringLen(BSTR);
     49 WINOLEAUTAPI_(UINT) SysStringByteLen(BSTR bstr);
     50 WINOLEAUTAPI_(BSTR) SysAllocStringByteLen(LPCSTR psz,UINT len);
     51 WINOLEAUTAPI_(INT) DosDateTimeToVariantTime(USHORT wDosDate,USHORT wDosTime,DOUBLE *pvtime);
     52 WINOLEAUTAPI_(INT) VariantTimeToDosDateTime(DOUBLE vtime,USHORT *pwDosDate,USHORT *pwDosTime);
     53 WINOLEAUTAPI_(INT) SystemTimeToVariantTime(LPSYSTEMTIME lpSystemTime,DOUBLE *pvtime);
     54 WINOLEAUTAPI_(INT) VariantTimeToSystemTime(DOUBLE vtime,LPSYSTEMTIME lpSystemTime);
     55 WINOLEAUTAPI SafeArrayAllocDescriptor(UINT cDims,SAFEARRAY **ppsaOut);
     56 WINOLEAUTAPI SafeArrayAllocDescriptorEx(VARTYPE vt,UINT cDims,SAFEARRAY **ppsaOut);
     57 WINOLEAUTAPI SafeArrayAllocData(SAFEARRAY *psa);
     58 WINOLEAUTAPI_(SAFEARRAY *) SafeArrayCreate(VARTYPE vt,UINT cDims,SAFEARRAYBOUND *rgsabound);
     59 WINOLEAUTAPI_(SAFEARRAY *) SafeArrayCreateEx(VARTYPE vt,UINT cDims,SAFEARRAYBOUND *rgsabound,PVOID pvExtra);
     60 WINOLEAUTAPI SafeArrayCopyData(SAFEARRAY *psaSource,SAFEARRAY *psaTarget);
     61 WINOLEAUTAPI SafeArrayDestroyDescriptor(SAFEARRAY *psa);
     62 WINOLEAUTAPI SafeArrayDestroyData(SAFEARRAY *psa);
     63 WINOLEAUTAPI SafeArrayDestroy(SAFEARRAY *psa);
     64 WINOLEAUTAPI SafeArrayRedim(SAFEARRAY *psa,SAFEARRAYBOUND *psaboundNew);
     65 WINOLEAUTAPI_(UINT) SafeArrayGetDim(SAFEARRAY *psa);
     66 WINOLEAUTAPI_(UINT) SafeArrayGetElemsize(SAFEARRAY *psa);
     67 WINOLEAUTAPI SafeArrayGetUBound(SAFEARRAY *psa,UINT nDim,LONG *plUbound);
     68 WINOLEAUTAPI SafeArrayGetLBound(SAFEARRAY *psa,UINT nDim,LONG *plLbound);
     69 WINOLEAUTAPI SafeArrayLock(SAFEARRAY *psa);
     70 WINOLEAUTAPI SafeArrayUnlock(SAFEARRAY *psa);
     71 WINOLEAUTAPI SafeArrayAccessData(SAFEARRAY *psa,void HUGEP **ppvData);
     72 WINOLEAUTAPI SafeArrayUnaccessData(SAFEARRAY *psa);
     73 WINOLEAUTAPI SafeArrayGetElement(SAFEARRAY *psa,LONG *rgIndices,void *pv);
     74 WINOLEAUTAPI SafeArrayPutElement(SAFEARRAY *psa,LONG *rgIndices,void *pv);
     75 WINOLEAUTAPI SafeArrayCopy(SAFEARRAY *psa,SAFEARRAY **ppsaOut);
     76 WINOLEAUTAPI SafeArrayPtrOfIndex(SAFEARRAY *psa,LONG *rgIndices,void **ppvData);
     77 WINOLEAUTAPI SafeArraySetRecordInfo(SAFEARRAY *psa,IRecordInfo *prinfo);
     78 WINOLEAUTAPI SafeArrayGetRecordInfo(SAFEARRAY *psa,IRecordInfo **prinfo);
     79 WINOLEAUTAPI SafeArraySetIID(SAFEARRAY *psa,REFGUID guid);
     80 WINOLEAUTAPI SafeArrayGetIID(SAFEARRAY *psa,GUID *pguid);
     81 WINOLEAUTAPI SafeArrayGetVartype(SAFEARRAY *psa,VARTYPE *pvt);
     82 WINOLEAUTAPI_(SAFEARRAY *) SafeArrayCreateVector(VARTYPE vt,LONG lLbound,ULONG cElements);
     83 WINOLEAUTAPI_(SAFEARRAY *) SafeArrayCreateVectorEx(VARTYPE vt,LONG lLbound,ULONG cElements,PVOID pvExtra);
     84 WINOLEAUTAPI_(void) VariantInit(VARIANTARG *pvarg);
     85 WINOLEAUTAPI VariantClear(VARIANTARG *pvarg);
     86 WINOLEAUTAPI VariantCopy(VARIANTARG *pvargDest,VARIANTARG *pvargSrc);
     87 WINOLEAUTAPI VariantCopyInd(VARIANT *pvarDest,VARIANTARG *pvargSrc);
     88 WINOLEAUTAPI VariantChangeType(VARIANTARG *pvargDest,VARIANTARG *pvarSrc,USHORT wFlags,VARTYPE vt);
     89 WINOLEAUTAPI VariantChangeTypeEx(VARIANTARG *pvargDest,VARIANTARG *pvarSrc,LCID lcid,USHORT wFlags,VARTYPE vt);
     90 
     91 #define VARIANT_NOVALUEPROP 0x01
     92 #define VARIANT_ALPHABOOL 0x02
     93 #define VARIANT_NOUSEROVERRIDE 0x04
     94 #define VARIANT_CALENDAR_HIJRI 0x08
     95 #define VARIANT_LOCALBOOL 0x10
     96 #define VARIANT_CALENDAR_THAI 0x20
     97 #define VARIANT_CALENDAR_GREGORIAN 0x40
     98 #define VARIANT_USE_NLS 0x80
     99 
    100 WINOLEAUTAPI VectorFromBstr (BSTR bstr,SAFEARRAY **ppsa);
    101 WINOLEAUTAPI BstrFromVector (SAFEARRAY *psa,BSTR *pbstr);
    102 
    103 #define VAR_TIMEVALUEONLY ((DWORD)0x00000001)
    104 #define VAR_DATEVALUEONLY ((DWORD)0x00000002)
    105 #define VAR_VALIDDATE ((DWORD)0x00000004)
    106 #define VAR_CALENDAR_HIJRI ((DWORD)0x00000008)
    107 #define VAR_LOCALBOOL ((DWORD)0x00000010)
    108 #define VAR_FORMAT_NOSUBSTITUTE ((DWORD)0x00000020)
    109 #define VAR_FOURDIGITYEARS ((DWORD)0x00000040)
    110 
    111 #ifndef LOCALE_USE_NLS
    112 #define LOCALE_USE_NLS 0x10000000
    113 #endif
    114 
    115 #define VAR_CALENDAR_THAI ((DWORD)0x00000080)
    116 #define VAR_CALENDAR_GREGORIAN ((DWORD)0x00000100)
    117 
    118 #define VTDATEGRE_MAX 2958465
    119 #define VTDATEGRE_MIN -657434
    120 
    121 WINOLEAUTAPI VarUI1FromI2(SHORT sIn,BYTE *pbOut);
    122 WINOLEAUTAPI VarUI1FromI4(LONG lIn,BYTE *pbOut);
    123 WINOLEAUTAPI VarUI1FromI8(LONG64 i64In,BYTE *pbOut);
    124 WINOLEAUTAPI VarUI1FromR4(FLOAT fltIn,BYTE *pbOut);
    125 WINOLEAUTAPI VarUI1FromR8(DOUBLE dblIn,BYTE *pbOut);
    126 WINOLEAUTAPI VarUI1FromCy(CY cyIn,BYTE *pbOut);
    127 WINOLEAUTAPI VarUI1FromDate(DATE dateIn,BYTE *pbOut);
    128 WINOLEAUTAPI VarUI1FromStr(OLECHAR *strIn,LCID lcid,ULONG dwFlags,BYTE *pbOut);
    129 WINOLEAUTAPI VarUI1FromDisp(IDispatch *pdispIn,LCID lcid,BYTE *pbOut);
    130 WINOLEAUTAPI VarUI1FromBool(VARIANT_BOOL boolIn,BYTE *pbOut);
    131 WINOLEAUTAPI VarUI1FromI1(CHAR cIn,BYTE *pbOut);
    132 WINOLEAUTAPI VarUI1FromUI2(USHORT uiIn,BYTE *pbOut);
    133 WINOLEAUTAPI VarUI1FromUI4(ULONG ulIn,BYTE *pbOut);
    134 WINOLEAUTAPI VarUI1FromUI8(ULONG64 ui64In,BYTE *pbOut);
    135 WINOLEAUTAPI VarUI1FromDec(DECIMAL *pdecIn,BYTE *pbOut);
    136 WINOLEAUTAPI VarI2FromUI1(BYTE bIn,SHORT *psOut);
    137 WINOLEAUTAPI VarI2FromI4(LONG lIn,SHORT *psOut);
    138 WINOLEAUTAPI VarI2FromI8(LONG64 i64In,SHORT *psOut);
    139 WINOLEAUTAPI VarI2FromR4(FLOAT fltIn,SHORT *psOut);
    140 WINOLEAUTAPI VarI2FromR8(DOUBLE dblIn,SHORT *psOut);
    141 WINOLEAUTAPI VarI2FromCy(CY cyIn,SHORT *psOut);
    142 WINOLEAUTAPI VarI2FromDate(DATE dateIn,SHORT *psOut);
    143 WINOLEAUTAPI VarI2FromStr(OLECHAR *strIn,LCID lcid,ULONG dwFlags,SHORT *psOut);
    144 WINOLEAUTAPI VarI2FromDisp(IDispatch *pdispIn,LCID lcid,SHORT *psOut);
    145 WINOLEAUTAPI VarI2FromBool(VARIANT_BOOL boolIn,SHORT *psOut);
    146 WINOLEAUTAPI VarI2FromI1(CHAR cIn,SHORT *psOut);
    147 WINOLEAUTAPI VarI2FromUI2(USHORT uiIn,SHORT *psOut);
    148 WINOLEAUTAPI VarI2FromUI4(ULONG ulIn,SHORT *psOut);
    149 WINOLEAUTAPI VarI2FromUI8(ULONG64 ui64In,SHORT *psOut);
    150 WINOLEAUTAPI VarI2FromDec(DECIMAL *pdecIn,SHORT *psOut);
    151 WINOLEAUTAPI VarI4FromUI1(BYTE bIn,LONG *plOut);
    152 WINOLEAUTAPI VarI4FromI2(SHORT sIn,LONG *plOut);
    153 WINOLEAUTAPI VarI4FromI8(LONG64 i64In,LONG *plOut);
    154 WINOLEAUTAPI VarI4FromR4(FLOAT fltIn,LONG *plOut);
    155 WINOLEAUTAPI VarI4FromR8(DOUBLE dblIn,LONG *plOut);
    156 WINOLEAUTAPI VarI4FromCy(CY cyIn,LONG *plOut);
    157 WINOLEAUTAPI VarI4FromDate(DATE dateIn,LONG *plOut);
    158 WINOLEAUTAPI VarI4FromStr(OLECHAR *strIn,LCID lcid,ULONG dwFlags,LONG *plOut);
    159 WINOLEAUTAPI VarI4FromDisp(IDispatch *pdispIn,LCID lcid,LONG *plOut);
    160 WINOLEAUTAPI VarI4FromBool(VARIANT_BOOL boolIn,LONG *plOut);
    161 WINOLEAUTAPI VarI4FromI1(CHAR cIn,LONG *plOut);
    162 WINOLEAUTAPI VarI4FromUI2(USHORT uiIn,LONG *plOut);
    163 WINOLEAUTAPI VarI4FromUI4(ULONG ulIn,LONG *plOut);
    164 WINOLEAUTAPI VarI4FromUI8(ULONG64 ui64In,LONG *plOut);
    165 WINOLEAUTAPI VarI4FromDec(DECIMAL *pdecIn,LONG *plOut);
    166 WINOLEAUTAPI VarI4FromInt(INT intIn,LONG *plOut);
    167 WINOLEAUTAPI VarI8FromUI1(BYTE bIn,LONG64 *pi64Out);
    168 WINOLEAUTAPI VarI8FromI2(SHORT sIn,LONG64 *pi64Out);
    169 WINOLEAUTAPI VarI8FromI4(LONG lIn,LONG64 *pi64Out);
    170 WINOLEAUTAPI VarI8FromR4(FLOAT fltIn,LONG64 *pi64Out);
    171 WINOLEAUTAPI VarI8FromR8(DOUBLE dblIn,LONG64 *pi64Out);
    172 WINOLEAUTAPI VarI8FromCy(CY cyIn,LONG64 *pi64Out);
    173 WINOLEAUTAPI VarI8FromDate(DATE dateIn,LONG64 *pi64Out);
    174 WINOLEAUTAPI VarI8FromStr(OLECHAR *strIn,LCID lcid,unsigned __LONG32 dwFlags,LONG64 *pi64Out);
    175 WINOLEAUTAPI VarI8FromDisp(IDispatch *pdispIn,LCID lcid,LONG64 *pi64Out);
    176 WINOLEAUTAPI VarI8FromBool(VARIANT_BOOL boolIn,LONG64 *pi64Out);
    177 WINOLEAUTAPI VarI8FromI1(CHAR cIn,LONG64 *pi64Out);
    178 WINOLEAUTAPI VarI8FromUI2(USHORT uiIn,LONG64 *pi64Out);
    179 WINOLEAUTAPI VarI8FromUI4(ULONG ulIn,LONG64 *pi64Out);
    180 WINOLEAUTAPI VarI8FromUI8(ULONG64 ui64In,LONG64 *pi64Out);
    181 WINOLEAUTAPI VarI8FromDec(DECIMAL *pdecIn,LONG64 *pi64Out);
    182 WINOLEAUTAPI VarI8FromInt(INT intIn,LONG64 *pi64Out);
    183 WINOLEAUTAPI VarR4FromUI1(BYTE bIn,FLOAT *pfltOut);
    184 WINOLEAUTAPI VarR4FromI2(SHORT sIn,FLOAT *pfltOut);
    185 WINOLEAUTAPI VarR4FromI4(LONG lIn,FLOAT *pfltOut);
    186 WINOLEAUTAPI VarR4FromI8(LONG64 i64In,FLOAT *pfltOut);
    187 WINOLEAUTAPI VarR4FromR8(DOUBLE dblIn,FLOAT *pfltOut);
    188 WINOLEAUTAPI VarR4FromCy(CY cyIn,FLOAT *pfltOut);
    189 WINOLEAUTAPI VarR4FromDate(DATE dateIn,FLOAT *pfltOut);
    190 WINOLEAUTAPI VarR4FromStr(OLECHAR *strIn,LCID lcid,ULONG dwFlags,FLOAT *pfltOut);
    191 WINOLEAUTAPI VarR4FromDisp(IDispatch *pdispIn,LCID lcid,FLOAT *pfltOut);
    192 WINOLEAUTAPI VarR4FromBool(VARIANT_BOOL boolIn,FLOAT *pfltOut);
    193 WINOLEAUTAPI VarR4FromI1(CHAR cIn,FLOAT *pfltOut);
    194 WINOLEAUTAPI VarR4FromUI2(USHORT uiIn,FLOAT *pfltOut);
    195 WINOLEAUTAPI VarR4FromUI4(ULONG ulIn,FLOAT *pfltOut);
    196 WINOLEAUTAPI VarR4FromUI8(ULONG64 ui64In,FLOAT *pfltOut);
    197 WINOLEAUTAPI VarR4FromDec(DECIMAL *pdecIn,FLOAT *pfltOut);
    198 WINOLEAUTAPI VarR8FromUI1(BYTE bIn,DOUBLE *pdblOut);
    199 WINOLEAUTAPI VarR8FromI2(SHORT sIn,DOUBLE *pdblOut);
    200 WINOLEAUTAPI VarR8FromI4(LONG lIn,DOUBLE *pdblOut);
    201 WINOLEAUTAPI VarR8FromI8(LONG64 i64In,DOUBLE *pdblOut);
    202 WINOLEAUTAPI VarR8FromR4(FLOAT fltIn,DOUBLE *pdblOut);
    203 WINOLEAUTAPI VarR8FromCy(CY cyIn,DOUBLE *pdblOut);
    204 WINOLEAUTAPI VarR8FromDate(DATE dateIn,DOUBLE *pdblOut);
    205 WINOLEAUTAPI VarR8FromStr(OLECHAR *strIn,LCID lcid,ULONG dwFlags,DOUBLE *pdblOut);
    206 WINOLEAUTAPI VarR8FromDisp(IDispatch *pdispIn,LCID lcid,DOUBLE *pdblOut);
    207 WINOLEAUTAPI VarR8FromBool(VARIANT_BOOL boolIn,DOUBLE *pdblOut);
    208 WINOLEAUTAPI VarR8FromI1(CHAR cIn,DOUBLE *pdblOut);
    209 WINOLEAUTAPI VarR8FromUI2(USHORT uiIn,DOUBLE *pdblOut);
    210 WINOLEAUTAPI VarR8FromUI4(ULONG ulIn,DOUBLE *pdblOut);
    211 WINOLEAUTAPI VarR8FromUI8(ULONG64 ui64In,DOUBLE *pdblOut);
    212 WINOLEAUTAPI VarR8FromDec(DECIMAL *pdecIn,DOUBLE *pdblOut);
    213 WINOLEAUTAPI VarDateFromUI1(BYTE bIn,DATE *pdateOut);
    214 WINOLEAUTAPI VarDateFromI2(SHORT sIn,DATE *pdateOut);
    215 WINOLEAUTAPI VarDateFromI4(LONG lIn,DATE *pdateOut);
    216 WINOLEAUTAPI VarDateFromI8(LONG64 i64In,DATE *pdateOut);
    217 WINOLEAUTAPI VarDateFromR4(FLOAT fltIn,DATE *pdateOut);
    218 WINOLEAUTAPI VarDateFromR8(DOUBLE dblIn,DATE *pdateOut);
    219 WINOLEAUTAPI VarDateFromCy(CY cyIn,DATE *pdateOut);
    220 WINOLEAUTAPI VarDateFromStr(OLECHAR *strIn,LCID lcid,ULONG dwFlags,DATE *pdateOut);
    221 WINOLEAUTAPI VarDateFromDisp(IDispatch *pdispIn,LCID lcid,DATE *pdateOut);
    222 WINOLEAUTAPI VarDateFromBool(VARIANT_BOOL boolIn,DATE *pdateOut);
    223 WINOLEAUTAPI VarDateFromI1(CHAR cIn,DATE *pdateOut);
    224 WINOLEAUTAPI VarDateFromUI2(USHORT uiIn,DATE *pdateOut);
    225 WINOLEAUTAPI VarDateFromUI4(ULONG ulIn,DATE *pdateOut);
    226 WINOLEAUTAPI VarDateFromUI8(ULONG64 ui64In,DATE *pdateOut);
    227 WINOLEAUTAPI VarDateFromDec(DECIMAL *pdecIn,DATE *pdateOut);
    228 WINOLEAUTAPI VarCyFromUI1(BYTE bIn,CY *pcyOut);
    229 WINOLEAUTAPI VarCyFromI2(SHORT sIn,CY *pcyOut);
    230 WINOLEAUTAPI VarCyFromI4(LONG lIn,CY *pcyOut);
    231 WINOLEAUTAPI VarCyFromI8(LONG64 i64In,CY *pcyOut);
    232 WINOLEAUTAPI VarCyFromR4(FLOAT fltIn,CY *pcyOut);
    233 WINOLEAUTAPI VarCyFromR8(DOUBLE dblIn,CY *pcyOut);
    234 WINOLEAUTAPI VarCyFromDate(DATE dateIn,CY *pcyOut);
    235 WINOLEAUTAPI VarCyFromStr(OLECHAR *strIn,LCID lcid,ULONG dwFlags,CY *pcyOut);
    236 WINOLEAUTAPI VarCyFromDisp(IDispatch *pdispIn,LCID lcid,CY *pcyOut);
    237 WINOLEAUTAPI VarCyFromBool(VARIANT_BOOL boolIn,CY *pcyOut);
    238 WINOLEAUTAPI VarCyFromI1(CHAR cIn,CY *pcyOut);
    239 WINOLEAUTAPI VarCyFromUI2(USHORT uiIn,CY *pcyOut);
    240 WINOLEAUTAPI VarCyFromUI4(ULONG ulIn,CY *pcyOut);
    241 WINOLEAUTAPI VarCyFromUI8(ULONG64 ui64In,CY *pcyOut);
    242 WINOLEAUTAPI VarCyFromDec(DECIMAL *pdecIn,CY *pcyOut);
    243 WINOLEAUTAPI VarBstrFromUI1(BYTE bVal,LCID lcid,ULONG dwFlags,BSTR *pbstrOut);
    244 WINOLEAUTAPI VarBstrFromI2(SHORT iVal,LCID lcid,ULONG dwFlags,BSTR *pbstrOut);
    245 WINOLEAUTAPI VarBstrFromI4(LONG lIn,LCID lcid,ULONG dwFlags,BSTR *pbstrOut);
    246 WINOLEAUTAPI VarBstrFromI8(LONG64 i64In,LCID lcid,unsigned __LONG32 dwFlags,BSTR *pbstrOut);
    247 WINOLEAUTAPI VarBstrFromR4(FLOAT fltIn,LCID lcid,ULONG dwFlags,BSTR *pbstrOut);
    248 WINOLEAUTAPI VarBstrFromR8(DOUBLE dblIn,LCID lcid,ULONG dwFlags,BSTR *pbstrOut);
    249 WINOLEAUTAPI VarBstrFromCy(CY cyIn,LCID lcid,ULONG dwFlags,BSTR *pbstrOut);
    250 WINOLEAUTAPI VarBstrFromDate(DATE dateIn,LCID lcid,ULONG dwFlags,BSTR *pbstrOut);
    251 WINOLEAUTAPI VarBstrFromDisp(IDispatch *pdispIn,LCID lcid,ULONG dwFlags,BSTR *pbstrOut);
    252 WINOLEAUTAPI VarBstrFromBool(VARIANT_BOOL boolIn,LCID lcid,ULONG dwFlags,BSTR *pbstrOut);
    253 WINOLEAUTAPI VarBstrFromI1(CHAR cIn,LCID lcid,ULONG dwFlags,BSTR *pbstrOut);
    254 WINOLEAUTAPI VarBstrFromUI2(USHORT uiIn,LCID lcid,ULONG dwFlags,BSTR *pbstrOut);
    255 WINOLEAUTAPI VarBstrFromUI4(ULONG ulIn,LCID lcid,ULONG dwFlags,BSTR *pbstrOut);
    256 WINOLEAUTAPI VarBstrFromUI8(ULONG64 ui64In,LCID lcid,unsigned __LONG32 dwFlags,BSTR *pbstrOut);
    257 WINOLEAUTAPI VarBstrFromDec(DECIMAL *pdecIn,LCID lcid,ULONG dwFlags,BSTR *pbstrOut);
    258 WINOLEAUTAPI VarBoolFromUI1(BYTE bIn,VARIANT_BOOL *pboolOut);
    259 WINOLEAUTAPI VarBoolFromI2(SHORT sIn,VARIANT_BOOL *pboolOut);
    260 WINOLEAUTAPI VarBoolFromI4(LONG lIn,VARIANT_BOOL *pboolOut);
    261 WINOLEAUTAPI VarBoolFromI8(LONG64 i64In,VARIANT_BOOL *pboolOut);
    262 WINOLEAUTAPI VarBoolFromR4(FLOAT fltIn,VARIANT_BOOL *pboolOut);
    263 WINOLEAUTAPI VarBoolFromR8(DOUBLE dblIn,VARIANT_BOOL *pboolOut);
    264 WINOLEAUTAPI VarBoolFromDate(DATE dateIn,VARIANT_BOOL *pboolOut);
    265 WINOLEAUTAPI VarBoolFromCy(CY cyIn,VARIANT_BOOL *pboolOut);
    266 WINOLEAUTAPI VarBoolFromStr(OLECHAR *strIn,LCID lcid,ULONG dwFlags,VARIANT_BOOL *pboolOut);
    267 WINOLEAUTAPI VarBoolFromDisp(IDispatch *pdispIn,LCID lcid,VARIANT_BOOL *pboolOut);
    268 WINOLEAUTAPI VarBoolFromI1(CHAR cIn,VARIANT_BOOL *pboolOut);
    269 WINOLEAUTAPI VarBoolFromUI2(USHORT uiIn,VARIANT_BOOL *pboolOut);
    270 WINOLEAUTAPI VarBoolFromUI4(ULONG ulIn,VARIANT_BOOL *pboolOut);
    271 WINOLEAUTAPI VarBoolFromUI8(ULONG64 i64In,VARIANT_BOOL *pboolOut);
    272 WINOLEAUTAPI VarBoolFromDec(DECIMAL *pdecIn,VARIANT_BOOL *pboolOut);
    273 WINOLEAUTAPI VarI1FromUI1(BYTE bIn,CHAR *pcOut);
    274 WINOLEAUTAPI VarI1FromI2(SHORT uiIn,CHAR *pcOut);
    275 WINOLEAUTAPI VarI1FromI4(LONG lIn,CHAR *pcOut);
    276 WINOLEAUTAPI VarI1FromI8(LONG64 i64In,CHAR *pcOut);
    277 WINOLEAUTAPI VarI1FromR4(FLOAT fltIn,CHAR *pcOut);
    278 WINOLEAUTAPI VarI1FromR8(DOUBLE dblIn,CHAR *pcOut);
    279 WINOLEAUTAPI VarI1FromDate(DATE dateIn,CHAR *pcOut);
    280 WINOLEAUTAPI VarI1FromCy(CY cyIn,CHAR *pcOut);
    281 WINOLEAUTAPI VarI1FromStr(OLECHAR *strIn,LCID lcid,ULONG dwFlags,CHAR *pcOut);
    282 WINOLEAUTAPI VarI1FromDisp(IDispatch *pdispIn,LCID lcid,CHAR *pcOut);
    283 WINOLEAUTAPI VarI1FromBool(VARIANT_BOOL boolIn,CHAR *pcOut);
    284 WINOLEAUTAPI VarI1FromUI2(USHORT uiIn,CHAR *pcOut);
    285 WINOLEAUTAPI VarI1FromUI4(ULONG ulIn,CHAR *pcOut);
    286 WINOLEAUTAPI VarI1FromUI8(ULONG64 i64In,CHAR *pcOut);
    287 WINOLEAUTAPI VarI1FromDec(DECIMAL *pdecIn,CHAR *pcOut);
    288 WINOLEAUTAPI VarUI2FromUI1(BYTE bIn,USHORT *puiOut);
    289 WINOLEAUTAPI VarUI2FromI2(SHORT uiIn,USHORT *puiOut);
    290 WINOLEAUTAPI VarUI2FromI4(LONG lIn,USHORT *puiOut);
    291 WINOLEAUTAPI VarUI2FromI8(LONG64 i64In,USHORT *puiOut);
    292 WINOLEAUTAPI VarUI2FromR4(FLOAT fltIn,USHORT *puiOut);
    293 WINOLEAUTAPI VarUI2FromR8(DOUBLE dblIn,USHORT *puiOut);
    294 WINOLEAUTAPI VarUI2FromDate(DATE dateIn,USHORT *puiOut);
    295 WINOLEAUTAPI VarUI2FromCy(CY cyIn,USHORT *puiOut);
    296 WINOLEAUTAPI VarUI2FromStr(OLECHAR *strIn,LCID lcid,ULONG dwFlags,USHORT *puiOut);
    297 WINOLEAUTAPI VarUI2FromDisp(IDispatch *pdispIn,LCID lcid,USHORT *puiOut);
    298 WINOLEAUTAPI VarUI2FromBool(VARIANT_BOOL boolIn,USHORT *puiOut);
    299 WINOLEAUTAPI VarUI2FromI1(CHAR cIn,USHORT *puiOut);
    300 WINOLEAUTAPI VarUI2FromUI4(ULONG ulIn,USHORT *puiOut);
    301 WINOLEAUTAPI VarUI2FromUI8(ULONG64 i64In,USHORT *puiOut);
    302 WINOLEAUTAPI VarUI2FromDec(DECIMAL *pdecIn,USHORT *puiOut);
    303 WINOLEAUTAPI VarUI4FromUI1(BYTE bIn,ULONG *pulOut);
    304 WINOLEAUTAPI VarUI4FromI2(SHORT uiIn,ULONG *pulOut);
    305 WINOLEAUTAPI VarUI4FromI4(LONG lIn,ULONG *pulOut);
    306 WINOLEAUTAPI VarUI4FromI8(LONG64 i64In,ULONG *plOut);
    307 WINOLEAUTAPI VarUI4FromR4(FLOAT fltIn,ULONG *pulOut);
    308 WINOLEAUTAPI VarUI4FromR8(DOUBLE dblIn,ULONG *pulOut);
    309 WINOLEAUTAPI VarUI4FromDate(DATE dateIn,ULONG *pulOut);
    310 WINOLEAUTAPI VarUI4FromCy(CY cyIn,ULONG *pulOut);
    311 WINOLEAUTAPI VarUI4FromStr(OLECHAR *strIn,LCID lcid,ULONG dwFlags,ULONG *pulOut);
    312 WINOLEAUTAPI VarUI4FromDisp(IDispatch *pdispIn,LCID lcid,ULONG *pulOut);
    313 WINOLEAUTAPI VarUI4FromBool(VARIANT_BOOL boolIn,ULONG *pulOut);
    314 WINOLEAUTAPI VarUI4FromI1(CHAR cIn,ULONG *pulOut);
    315 WINOLEAUTAPI VarUI4FromUI2(USHORT uiIn,ULONG *pulOut);
    316 WINOLEAUTAPI VarUI4FromUI8(ULONG64 ui64In,ULONG *plOut);
    317 WINOLEAUTAPI VarUI4FromDec(DECIMAL *pdecIn,ULONG *pulOut);
    318 WINOLEAUTAPI VarUI8FromUI1(BYTE bIn,ULONG64 *pi64Out);
    319 WINOLEAUTAPI VarUI8FromI2(SHORT sIn,ULONG64 *pi64Out);
    320 WINOLEAUTAPI VarUI8FromI4(LONG lIn,ULONG64 *pi64Out);
    321 WINOLEAUTAPI VarUI8FromI8(LONG64 ui64In,ULONG64 *pi64Out);
    322 WINOLEAUTAPI VarUI8FromR4(FLOAT fltIn,ULONG64 *pi64Out);
    323 WINOLEAUTAPI VarUI8FromR8(DOUBLE dblIn,ULONG64 *pi64Out);
    324 WINOLEAUTAPI VarUI8FromCy(CY cyIn,ULONG64 *pi64Out);
    325 WINOLEAUTAPI VarUI8FromDate(DATE dateIn,ULONG64 *pi64Out);
    326 WINOLEAUTAPI VarUI8FromStr(OLECHAR *strIn,LCID lcid,unsigned __LONG32 dwFlags,ULONG64 *pi64Out);
    327 WINOLEAUTAPI VarUI8FromDisp(IDispatch *pdispIn,LCID lcid,ULONG64 *pi64Out);
    328 WINOLEAUTAPI VarUI8FromBool(VARIANT_BOOL boolIn,ULONG64 *pi64Out);
    329 WINOLEAUTAPI VarUI8FromI1(CHAR cIn,ULONG64 *pi64Out);
    330 WINOLEAUTAPI VarUI8FromUI2(USHORT uiIn,ULONG64 *pi64Out);
    331 WINOLEAUTAPI VarUI8FromUI4(ULONG ulIn,ULONG64 *pi64Out);
    332 WINOLEAUTAPI VarUI8FromDec(DECIMAL *pdecIn,ULONG64 *pi64Out);
    333 WINOLEAUTAPI VarUI8FromInt(INT intIn,ULONG64 *pi64Out);
    334 WINOLEAUTAPI VarDecFromUI1(BYTE bIn,DECIMAL *pdecOut);
    335 WINOLEAUTAPI VarDecFromI2(SHORT uiIn,DECIMAL *pdecOut);
    336 WINOLEAUTAPI VarDecFromI4(LONG lIn,DECIMAL *pdecOut);
    337 WINOLEAUTAPI VarDecFromI8(LONG64 i64In,DECIMAL *pdecOut);
    338 WINOLEAUTAPI VarDecFromR4(FLOAT fltIn,DECIMAL *pdecOut);
    339 WINOLEAUTAPI VarDecFromR8(DOUBLE dblIn,DECIMAL *pdecOut);
    340 WINOLEAUTAPI VarDecFromDate(DATE dateIn,DECIMAL *pdecOut);
    341 WINOLEAUTAPI VarDecFromCy(CY cyIn,DECIMAL *pdecOut);
    342 WINOLEAUTAPI VarDecFromStr(OLECHAR *strIn,LCID lcid,ULONG dwFlags,DECIMAL *pdecOut);
    343 WINOLEAUTAPI VarDecFromDisp(IDispatch *pdispIn,LCID lcid,DECIMAL *pdecOut);
    344 WINOLEAUTAPI VarDecFromBool(VARIANT_BOOL boolIn,DECIMAL *pdecOut);
    345 WINOLEAUTAPI VarDecFromI1(CHAR cIn,DECIMAL *pdecOut);
    346 WINOLEAUTAPI VarDecFromUI2(USHORT uiIn,DECIMAL *pdecOut);
    347 WINOLEAUTAPI VarDecFromUI4(ULONG ulIn,DECIMAL *pdecOut);
    348 WINOLEAUTAPI VarDecFromUI8(ULONG64 ui64In,DECIMAL *pdecOut);
    349 
    350 #define VarUI4FromUI4(in,pOut) (*(pOut) = (in))
    351 #define VarI4FromI4(in,pOut) (*(pOut) = (in))
    352 
    353 WINOLEAUTAPI VarI4FromI8(LONG64 i64In,LONG *plOut);
    354 WINOLEAUTAPI VarI4FromUI8(ULONG64 ui64In,LONG *plOut);
    355 
    356 #define VarUI8FromUI8(in,pOut) (*(pOut) = (in))
    357 #define VarI8FromI8(in,pOut) (*(pOut) = (in))
    358 
    359 #define VarUI1FromInt VarUI1FromI4
    360 #define VarUI1FromUint VarUI1FromUI4
    361 #define VarI2FromInt VarI2FromI4
    362 #define VarI2FromUint VarI2FromUI4
    363 #define VarI4FromInt VarI4FromI4
    364 #define VarI4FromUint VarI4FromUI4
    365 #define VarI8FromInt VarI8FromI4
    366 #define VarI8FromUint VarI8FromUI4
    367 #define VarR4FromInt VarR4FromI4
    368 #define VarR4FromUint VarR4FromUI4
    369 #define VarR8FromInt VarR8FromI4
    370 #define VarR8FromUint VarR8FromUI4
    371 #define VarDateFromInt VarDateFromI4
    372 #define VarDateFromUint VarDateFromUI4
    373 #define VarCyFromInt VarCyFromI4
    374 #define VarCyFromUint VarCyFromUI4
    375 #define VarBstrFromInt VarBstrFromI4
    376 #define VarBstrFromUint VarBstrFromUI4
    377 #define VarBoolFromInt VarBoolFromI4
    378 #define VarBoolFromUint VarBoolFromUI4
    379 #define VarI1FromInt VarI1FromI4
    380 #define VarI1FromUint VarI1FromUI4
    381 #define VarUI2FromInt VarUI2FromI4
    382 #define VarUI2FromUint VarUI2FromUI4
    383 #define VarUI4FromInt VarUI4FromI4
    384 #define VarUI4FromUint VarUI4FromUI4
    385 #define VarDecFromInt VarDecFromI4
    386 #define VarDecFromUint VarDecFromUI4
    387 #define VarIntFromUI1 VarI4FromUI1
    388 #define VarIntFromI2 VarI4FromI2
    389 #define VarIntFromI4 VarI4FromI4
    390 #define VarIntFromI8 VarI4FromI8
    391 #define VarIntFromR4 VarI4FromR4
    392 #define VarIntFromR8 VarI4FromR8
    393 #define VarIntFromDate VarI4FromDate
    394 #define VarIntFromCy VarI4FromCy
    395 #define VarIntFromStr VarI4FromStr
    396 #define VarIntFromDisp VarI4FromDisp
    397 #define VarIntFromBool VarI4FromBool
    398 #define VarIntFromI1 VarI4FromI1
    399 #define VarIntFromUI2 VarI4FromUI2
    400 #define VarIntFromUI4 VarI4FromUI4
    401 #define VarIntFromUI8 VarI4FromUI8
    402 #define VarIntFromDec VarI4FromDec
    403 #define VarIntFromUint VarI4FromUI4
    404 #define VarUintFromUI1 VarUI4FromUI1
    405 #define VarUintFromI2 VarUI4FromI2
    406 #define VarUintFromI4 VarUI4FromI4
    407 #define VarUintFromI8 VarUI4FromI8
    408 #define VarUintFromR4 VarUI4FromR4
    409 #define VarUintFromR8 VarUI4FromR8
    410 #define VarUintFromDate VarUI4FromDate
    411 #define VarUintFromCy VarUI4FromCy
    412 #define VarUintFromStr VarUI4FromStr
    413 #define VarUintFromDisp VarUI4FromDisp
    414 #define VarUintFromBool VarUI4FromBool
    415 #define VarUintFromI1 VarUI4FromI1
    416 #define VarUintFromUI2 VarUI4FromUI2
    417 #define VarUintFromUI4 VarUI4FromUI4
    418 #define VarUintFromUI8 VarUI4FromUI8
    419 #define VarUintFromDec VarUI4FromDec
    420 #define VarUintFromInt VarUI4FromI4
    421 
    422 typedef struct {
    423   INT cDig;
    424   ULONG dwInFlags;
    425   ULONG dwOutFlags;
    426   INT cchUsed;
    427   INT nBaseShift;
    428   INT nPwr10;
    429 } NUMPARSE;
    430 
    431 #define NUMPRS_LEADING_WHITE 0x0001
    432 #define NUMPRS_TRAILING_WHITE 0x0002
    433 #define NUMPRS_LEADING_PLUS 0x0004
    434 #define NUMPRS_TRAILING_PLUS 0x0008
    435 #define NUMPRS_LEADING_MINUS 0x0010
    436 #define NUMPRS_TRAILING_MINUS 0x0020
    437 #define NUMPRS_HEX_OCT 0x0040
    438 #define NUMPRS_PARENS 0x0080
    439 #define NUMPRS_DECIMAL 0x0100
    440 #define NUMPRS_THOUSANDS 0x0200
    441 #define NUMPRS_CURRENCY 0x0400
    442 #define NUMPRS_EXPONENT 0x0800
    443 #define NUMPRS_USE_ALL 0x1000
    444 #define NUMPRS_STD 0x1FFF
    445 
    446 #define NUMPRS_NEG 0x10000
    447 #define NUMPRS_INEXACT 0x20000
    448 
    449 #define VTBIT_I1 (1 << VT_I1)
    450 #define VTBIT_UI1 (1 << VT_UI1)
    451 #define VTBIT_I2 (1 << VT_I2)
    452 #define VTBIT_UI2 (1 << VT_UI2)
    453 #define VTBIT_I4 (1 << VT_I4)
    454 #define VTBIT_UI4 (1 << VT_UI4)
    455 #define VTBIT_I8 (1 << VT_I8)
    456 #define VTBIT_UI8 (1 << VT_UI8)
    457 #define VTBIT_R4 (1 << VT_R4)
    458 #define VTBIT_R8 (1 << VT_R8)
    459 #define VTBIT_CY (1 << VT_CY)
    460 #define VTBIT_DECIMAL (1 << VT_DECIMAL)
    461 
    462 WINOLEAUTAPI VarParseNumFromStr(OLECHAR *strIn,LCID lcid,ULONG dwFlags,NUMPARSE *pnumprs,BYTE *rgbDig);
    463 WINOLEAUTAPI VarNumFromParseNum(NUMPARSE *pnumprs,BYTE *rgbDig,ULONG dwVtBits,VARIANT *pvar);
    464 STDAPI VarAdd(LPVARIANT pvarLeft,LPVARIANT pvarRight,LPVARIANT pvarResult);
    465 STDAPI VarAnd(LPVARIANT pvarLeft,LPVARIANT pvarRight,LPVARIANT pvarResult);
    466 STDAPI VarCat(LPVARIANT pvarLeft,LPVARIANT pvarRight,LPVARIANT pvarResult);
    467 STDAPI VarDiv(LPVARIANT pvarLeft,LPVARIANT pvarRight,LPVARIANT pvarResult);
    468 STDAPI VarEqv(LPVARIANT pvarLeft,LPVARIANT pvarRight,LPVARIANT pvarResult);
    469 STDAPI VarIdiv(LPVARIANT pvarLeft,LPVARIANT pvarRight,LPVARIANT pvarResult);
    470 STDAPI VarImp(LPVARIANT pvarLeft,LPVARIANT pvarRight,LPVARIANT pvarResult);
    471 STDAPI VarMod(LPVARIANT pvarLeft,LPVARIANT pvarRight,LPVARIANT pvarResult);
    472 STDAPI VarMul(LPVARIANT pvarLeft,LPVARIANT pvarRight,LPVARIANT pvarResult);
    473 STDAPI VarOr(LPVARIANT pvarLeft,LPVARIANT pvarRight,LPVARIANT pvarResult);
    474 STDAPI VarPow(LPVARIANT pvarLeft,LPVARIANT pvarRight,LPVARIANT pvarResult);
    475 STDAPI VarSub(LPVARIANT pvarLeft,LPVARIANT pvarRight,LPVARIANT pvarResult);
    476 STDAPI VarXor(LPVARIANT pvarLeft,LPVARIANT pvarRight,LPVARIANT pvarResult);
    477 STDAPI VarAbs(LPVARIANT pvarIn,LPVARIANT pvarResult);
    478 STDAPI VarFix(LPVARIANT pvarIn,LPVARIANT pvarResult);
    479 STDAPI VarInt(LPVARIANT pvarIn,LPVARIANT pvarResult);
    480 STDAPI VarNeg(LPVARIANT pvarIn,LPVARIANT pvarResult);
    481 STDAPI VarNot(LPVARIANT pvarIn,LPVARIANT pvarResult);
    482 STDAPI VarRound(LPVARIANT pvarIn,int cDecimals,LPVARIANT pvarResult);
    483 STDAPI VarCmp(LPVARIANT pvarLeft,LPVARIANT pvarRight,LCID lcid,ULONG dwFlags);
    484 
    485 #ifdef __cplusplus
    486 extern "C++" {
    487   static __inline HRESULT WINAPI VarCmp(LPVARIANT pvarLeft,LPVARIANT pvarRight,LCID lcid) { return VarCmp(pvarLeft,pvarRight,lcid,0); }
    488 }
    489 #endif
    490 
    491 STDAPI VarDecAdd(LPDECIMAL pdecLeft,LPDECIMAL pdecRight,LPDECIMAL pdecResult);
    492 STDAPI VarDecDiv(LPDECIMAL pdecLeft,LPDECIMAL pdecRight,LPDECIMAL pdecResult);
    493 STDAPI VarDecMul(LPDECIMAL pdecLeft,LPDECIMAL pdecRight,LPDECIMAL pdecResult);
    494 STDAPI VarDecSub(LPDECIMAL pdecLeft,LPDECIMAL pdecRight,LPDECIMAL pdecResult);
    495 STDAPI VarDecAbs(LPDECIMAL pdecIn,LPDECIMAL pdecResult);
    496 STDAPI VarDecFix(LPDECIMAL pdecIn,LPDECIMAL pdecResult);
    497 STDAPI VarDecInt(LPDECIMAL pdecIn,LPDECIMAL pdecResult);
    498 STDAPI VarDecNeg(LPDECIMAL pdecIn,LPDECIMAL pdecResult);
    499 STDAPI VarDecRound(LPDECIMAL pdecIn,int cDecimals,LPDECIMAL pdecResult);
    500 STDAPI VarDecCmp(LPDECIMAL pdecLeft,LPDECIMAL pdecRight);
    501 STDAPI VarDecCmpR8(LPDECIMAL pdecLeft,double dblRight);
    502 STDAPI VarCyAdd(CY cyLeft,CY cyRight,LPCY pcyResult);
    503 STDAPI VarCyMul(CY cyLeft,CY cyRight,LPCY pcyResult);
    504 STDAPI VarCyMulI4(CY cyLeft,__LONG32 lRight,LPCY pcyResult);
    505 STDAPI VarCyMulI8(CY cyLeft,LONG64 lRight,LPCY pcyResult);
    506 STDAPI VarCySub(CY cyLeft,CY cyRight,LPCY pcyResult);
    507 STDAPI VarCyAbs(CY cyIn,LPCY pcyResult);
    508 STDAPI VarCyFix(CY cyIn,LPCY pcyResult);
    509 STDAPI VarCyInt(CY cyIn,LPCY pcyResult);
    510 STDAPI VarCyNeg(CY cyIn,LPCY pcyResult);
    511 STDAPI VarCyRound(CY cyIn,int cDecimals,LPCY pcyResult);
    512 STDAPI VarCyCmp(CY cyLeft,CY cyRight);
    513 STDAPI VarCyCmpR8(CY cyLeft,double dblRight);
    514 STDAPI VarBstrCat(BSTR bstrLeft,BSTR bstrRight,LPBSTR pbstrResult);
    515 STDAPI VarBstrCmp(BSTR bstrLeft,BSTR bstrRight,LCID lcid,ULONG dwFlags);
    516 STDAPI VarR8Pow(double dblLeft,double dblRight,double *pdblResult);
    517 STDAPI VarR4CmpR8(float fltLeft,double dblRight);
    518 STDAPI VarR8Round(double dblIn,int cDecimals,double *pdblResult);
    519 
    520 #define VARCMP_LT 0
    521 #define VARCMP_EQ 1
    522 #define VARCMP_GT 2
    523 #define VARCMP_NULL 3
    524 
    525 #define VT_HARDTYPE VT_RESERVED
    526 
    527 typedef struct {
    528   SYSTEMTIME st;
    529   USHORT wDayOfYear;
    530 } UDATE;
    531 
    532 WINOLEAUTAPI VarDateFromUdate(UDATE *pudateIn,ULONG dwFlags,DATE *pdateOut);
    533 WINOLEAUTAPI VarDateFromUdateEx(UDATE *pudateIn,LCID lcid,ULONG dwFlags,DATE *pdateOut);
    534 WINOLEAUTAPI VarUdateFromDate(DATE dateIn,ULONG dwFlags,UDATE *pudateOut);
    535 WINOLEAUTAPI GetAltMonthNames(LCID lcid,LPOLESTR **prgp);
    536 WINOLEAUTAPI VarFormat(LPVARIANT pvarIn,LPOLESTR pstrFormat,int iFirstDay,int iFirstWeek,ULONG dwFlags,BSTR *pbstrOut);
    537 WINOLEAUTAPI VarFormatDateTime(LPVARIANT pvarIn,int iNamedFormat,ULONG dwFlags,BSTR *pbstrOut);
    538 WINOLEAUTAPI VarFormatNumber(LPVARIANT pvarIn,int iNumDig,int iIncLead,int iUseParens,int iGroup,ULONG dwFlags,BSTR *pbstrOut);
    539 WINOLEAUTAPI VarFormatPercent(LPVARIANT pvarIn,int iNumDig,int iIncLead,int iUseParens,int iGroup,ULONG dwFlags,BSTR *pbstrOut);
    540 WINOLEAUTAPI VarFormatCurrency(LPVARIANT pvarIn,int iNumDig,int iIncLead,int iUseParens,int iGroup,ULONG dwFlags,BSTR *pbstrOut);
    541 WINOLEAUTAPI VarWeekdayName(int iWeekday,int fAbbrev,int iFirstDay,ULONG dwFlags,BSTR *pbstrOut);
    542 WINOLEAUTAPI VarMonthName(int iMonth,int fAbbrev,ULONG dwFlags,BSTR *pbstrOut);
    543 WINOLEAUTAPI VarFormatFromTokens(LPVARIANT pvarIn,LPOLESTR pstrFormat,LPBYTE pbTokCur,ULONG dwFlags,BSTR *pbstrOut,LCID lcid);
    544 WINOLEAUTAPI VarTokenizeFormatString(LPOLESTR pstrFormat,LPBYTE rgbTok,int cbTok,int iFirstDay,int iFirstWeek,LCID lcid,int *pcbActual);
    545 
    546 #ifndef DEFINED_LPTYPELIB
    547 #define DEFINED_LPTYPELIB
    548 typedef ITypeLib *LPTYPELIB;
    549 #endif
    550 #ifndef DEFINED_DISPID_MEMBERID
    551 #define DEFINED_DISPID_MEMBERID
    552 typedef LONG DISPID;
    553 typedef DISPID MEMBERID;
    554 #endif
    555 
    556 #define MEMBERID_NIL DISPID_UNKNOWN
    557 #define ID_DEFAULTINST -2
    558 
    559 #define DISPATCH_METHOD 0x1
    560 #define DISPATCH_PROPERTYGET 0x2
    561 #define DISPATCH_PROPERTYPUT 0x4
    562 #define DISPATCH_PROPERTYPUTREF 0x8
    563 
    564 #ifndef DEFINDE_LPTYPEINFO
    565 #define DEFINDE_LPTYPEINFO
    566 typedef ITypeInfo *LPTYPEINFO;
    567 #endif
    568 #ifndef DEFINED_LPTYPECOMP
    569 #define DEFINED_LPTYPECOMP
    570 typedef ITypeComp *LPTYPECOMP;
    571 #endif
    572 #ifndef DEFINED_LPCREATETYPELIB
    573 #define DEFINED_LPCREATETYPELIB
    574 typedef ICreateTypeLib *LPCREATETYPELIB;
    575 #endif
    576 #ifndef DEFINE_LPCREATETYPEINFO
    577 #define DEFINE_LPCREATETYPEINFO
    578 typedef ICreateTypeInfo *LPCREATETYPEINFO;
    579 #endif
    580 
    581 WINOLEAUTAPI_(ULONG) LHashValOfNameSysA(SYSKIND syskind,LCID lcid,LPCSTR szName);
    582 WINOLEAUTAPI_(ULONG) LHashValOfNameSys(SYSKIND syskind,LCID lcid,const OLECHAR *szName);
    583 
    584 #define LHashValOfName(lcid,szName) LHashValOfNameSys(SYS_WIN32,lcid,szName)
    585 #define WHashValOfLHashVal(lhashval) ((USHORT) (0x0000ffff & (lhashval)))
    586 #define IsHashValCompatible(lhashval1,lhashval2) ((WINBOOL) ((0x00ff0000 & (lhashval1))==(0x00ff0000 & (lhashval2))))
    587 
    588 WINOLEAUTAPI LoadTypeLib(const OLECHAR *szFile,ITypeLib **pptlib);
    589 
    590 typedef enum tagREGKIND {
    591   REGKIND_DEFAULT,REGKIND_REGISTER,REGKIND_NONE
    592 } REGKIND;
    593 
    594 #define LOAD_TLB_AS_32BIT 0x20
    595 #define LOAD_TLB_AS_64BIT 0x40
    596 #define MASK_TO_RESET_TLB_BITS ~(LOAD_TLB_AS_32BIT | LOAD_TLB_AS_64BIT)
    597 
    598 WINOLEAUTAPI LoadTypeLibEx(LPCOLESTR szFile,REGKIND regkind,ITypeLib **pptlib);
    599 WINOLEAUTAPI LoadRegTypeLib(REFGUID rguid,WORD wVerMajor,WORD wVerMinor,LCID lcid,ITypeLib **pptlib);
    600 WINOLEAUTAPI QueryPathOfRegTypeLib(REFGUID guid,USHORT wMaj,USHORT wMin,LCID lcid,LPBSTR lpbstrPathName);
    601 WINOLEAUTAPI RegisterTypeLib(ITypeLib *ptlib,OLECHAR *szFullPath,OLECHAR *szHelpDir);
    602 WINOLEAUTAPI UnRegisterTypeLib(REFGUID libID,WORD wVerMajor,WORD wVerMinor,LCID lcid,SYSKIND syskind);
    603 WINOLEAUTAPI CreateTypeLib(SYSKIND syskind,const OLECHAR *szFile,ICreateTypeLib **ppctlib);
    604 WINOLEAUTAPI CreateTypeLib2(SYSKIND syskind,LPCOLESTR szFile,ICreateTypeLib2 **ppctlib);
    605 
    606 #ifndef DEFINED_LPDISPATCH
    607 #define DEFINED_LPDISPATCH
    608 typedef IDispatch *LPDISPATCH;
    609 #endif
    610 
    611 typedef struct tagPARAMDATA {
    612   OLECHAR *szName;
    613   VARTYPE vt;
    614 } PARAMDATA,*LPPARAMDATA;
    615 
    616 typedef struct tagMETHODDATA {
    617   OLECHAR *szName;
    618   PARAMDATA *ppdata;
    619   DISPID dispid;
    620   UINT iMeth;
    621   CALLCONV cc;
    622   UINT cArgs;
    623   WORD wFlags;
    624   VARTYPE vtReturn;
    625 } METHODDATA,*LPMETHODDATA;
    626 
    627 typedef struct tagINTERFACEDATA {
    628   METHODDATA *pmethdata;
    629   UINT cMembers;
    630 } INTERFACEDATA,*LPINTERFACEDATA;
    631 
    632 WINOLEAUTAPI DispGetParam(DISPPARAMS *pdispparams,UINT position,VARTYPE vtTarg,VARIANT *pvarResult,UINT *puArgErr);
    633 WINOLEAUTAPI DispGetIDsOfNames(ITypeInfo *ptinfo,OLECHAR **rgszNames,UINT cNames,DISPID *rgdispid);
    634 WINOLEAUTAPI DispInvoke(void *_this,ITypeInfo *ptinfo,DISPID dispidMember,WORD wFlags,DISPPARAMS *pparams,VARIANT *pvarResult,EXCEPINFO *pexcepinfo,UINT *puArgErr);
    635 WINOLEAUTAPI CreateDispTypeInfo(INTERFACEDATA *pidata,LCID lcid,ITypeInfo **pptinfo);
    636 WINOLEAUTAPI CreateStdDispatch(IUnknown *punkOuter,void *pvThis,ITypeInfo *ptinfo,IUnknown **ppunkStdDisp);
    637 WINOLEAUTAPI DispCallFunc(void *pvInstance,ULONG_PTR oVft,CALLCONV cc,VARTYPE vtReturn,UINT cActuals,VARTYPE *prgvt,VARIANTARG **prgpvarg,VARIANT *pvargResult);
    638 
    639 #define ACTIVEOBJECT_STRONG 0x0
    640 #define ACTIVEOBJECT_WEAK 0x1
    641 
    642 WINOLEAUTAPI RegisterActiveObject(IUnknown *punk,REFCLSID rclsid,DWORD dwFlags,DWORD *pdwRegister);
    643 WINOLEAUTAPI RevokeActiveObject(DWORD dwRegister,void *pvReserved);
    644 WINOLEAUTAPI GetActiveObject(REFCLSID rclsid,void *pvReserved,IUnknown **ppunk);
    645 WINOLEAUTAPI SetErrorInfo(ULONG dwReserved,IErrorInfo *perrinfo);
    646 WINOLEAUTAPI GetErrorInfo(ULONG dwReserved,IErrorInfo **pperrinfo);
    647 WINOLEAUTAPI CreateErrorInfo(ICreateErrorInfo **pperrinfo);
    648 WINOLEAUTAPI GetRecordInfoFromTypeInfo(ITypeInfo *pTypeInfo,IRecordInfo **ppRecInfo);
    649 WINOLEAUTAPI GetRecordInfoFromGuids(REFGUID rGuidTypeLib,ULONG uVerMajor,ULONG uVerMinor,LCID lcid,REFGUID rGuidTypeInfo,IRecordInfo **ppRecInfo);
    650 WINOLEAUTAPI_(ULONG) OaBuildVersion(void);
    651 WINOLEAUTAPI_(void) ClearCustData(LPCUSTDATA pCustData);
    652 
    653 #if defined(NONAMELESSUNION)
    654 #define V_UNION(X,Y) ((X)->n1.n2.n3.Y)
    655 #define V_VT(X) ((X)->n1.n2.vt)
    656 #define V_RECORDINFO(X) ((X)->n1.n2.n3.brecVal.pRecInfo)
    657 #define V_RECORD(X) ((X)->n1.n2.n3.brecVal.pvRecord)
    658 #else
    659 #define V_UNION(X,Y) ((X)->Y)
    660 #define V_VT(X) ((X)->vt)
    661 #define V_RECORDINFO(X) ((X)->pRecInfo)
    662 #define V_RECORD(X) ((X)->pvRecord)
    663 #endif
    664 
    665 #define V_ISBYREF(X) (V_VT(X)&VT_BYREF)
    666 #define V_ISARRAY(X) (V_VT(X)&VT_ARRAY)
    667 #define V_ISVECTOR(X) (V_VT(X)&VT_VECTOR)
    668 #define V_NONE(X) V_I2(X)
    669 
    670 #define V_UI1(X) V_UNION(X,bVal)
    671 #define V_UI1REF(X) V_UNION(X,pbVal)
    672 #define V_I2(X) V_UNION(X,iVal)
    673 #define V_I2REF(X) V_UNION(X,piVal)
    674 #define V_I4(X) V_UNION(X,lVal)
    675 #define V_I4REF(X) V_UNION(X,plVal)
    676 #define V_I8(X) V_UNION(X,llVal)
    677 #define V_I8REF(X) V_UNION(X,pllVal)
    678 #define V_R4(X) V_UNION(X,fltVal)
    679 #define V_R4REF(X) V_UNION(X,pfltVal)
    680 #define V_R8(X) V_UNION(X,dblVal)
    681 #define V_R8REF(X) V_UNION(X,pdblVal)
    682 #define V_I1(X) V_UNION(X,cVal)
    683 #define V_I1REF(X) V_UNION(X,pcVal)
    684 #define V_UI2(X) V_UNION(X,uiVal)
    685 #define V_UI2REF(X) V_UNION(X,puiVal)
    686 #define V_UI4(X) V_UNION(X,ulVal)
    687 #define V_UI4REF(X) V_UNION(X,pulVal)
    688 #define V_UI8(X) V_UNION(X,ullVal)
    689 #define V_UI8REF(X) V_UNION(X,pullVal)
    690 #define V_INT(X) V_UNION(X,intVal)
    691 #define V_INTREF(X) V_UNION(X,pintVal)
    692 #define V_UINT(X) V_UNION(X,uintVal)
    693 #define V_UINTREF(X) V_UNION(X,puintVal)
    694 
    695 #ifdef _WIN64
    696 #define V_INT_PTR(X) V_UNION(X,llVal)
    697 #define V_UINT_PTR(X) V_UNION(X,ullVal)
    698 #define V_INT_PTRREF(X) V_UNION(X,pllVal)
    699 #define V_UINT_PTRREF(X) V_UNION(X,pullVal)
    700 #else
    701 #define V_INT_PTR(X) V_UNION(X,lVal)
    702 #define V_UINT_PTR(X) V_UNION(X,ulVal)
    703 #define V_INT_PTRREF(X) V_UNION(X,plVal)
    704 #define V_UINT_PTRREF(X) V_UNION(X,pulVal)
    705 #endif
    706 
    707 #define V_CY(X) V_UNION(X,cyVal)
    708 #define V_CYREF(X) V_UNION(X,pcyVal)
    709 #define V_DATE(X) V_UNION(X,date)
    710 #define V_DATEREF(X) V_UNION(X,pdate)
    711 #define V_BSTR(X) V_UNION(X,bstrVal)
    712 #define V_BSTRREF(X) V_UNION(X,pbstrVal)
    713 #define V_DISPATCH(X) V_UNION(X,pdispVal)
    714 #define V_DISPATCHREF(X) V_UNION(X,ppdispVal)
    715 #define V_ERROR(X) V_UNION(X,scode)
    716 #define V_ERRORREF(X) V_UNION(X,pscode)
    717 #define V_BOOL(X) V_UNION(X,boolVal)
    718 #define V_BOOLREF(X) V_UNION(X,pboolVal)
    719 #define V_UNKNOWN(X) V_UNION(X,punkVal)
    720 #define V_UNKNOWNREF(X) V_UNION(X,ppunkVal)
    721 #define V_VARIANTREF(X) V_UNION(X,pvarVal)
    722 #define V_ARRAY(X) V_UNION(X,parray)
    723 #define V_ARRAYREF(X) V_UNION(X,pparray)
    724 #define V_BYREF(X) V_UNION(X,byref)
    725 
    726 #define V_DECIMAL(X) V_UNION(X,decVal)
    727 #define V_DECIMALREF(X) V_UNION(X,pdecVal)
    728 
    729 #ifndef RC_INVOKED
    730 #include <poppack.h>
    731 #endif
    732 #endif
    733