' ########################################################################################
' Microsoft Windows
' File: OleAuto.inc
' Contents: Defines Ole Automation support function prototypes, constants
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_OleAuto_PBI)
#DEFINE PBX_OleAuto_PBI
%EQUATE `OLEAUTO_INC = 1
#INCLUDE ONCE "Legacy/COM/Ole2.inc"
'// Set packing to 8 for ISV, and Win95 support
'#ifndef RC_INVOKED
'#include <pshpack8.h>
'#endif // RC_INVOKED
'EXTERN_C const IID IID_StdOle;
$IID_StdOle = GUID$("{00020430-0000-0000-C000-000000000046}")
%EQUATE `STDOLE_MAJORVERNUM = &H1
%EQUATE `STDOLE_MINORVERNUM = &H0
%EQUATE `STDOLE_LCID = &H0000
'// Version # of stdole2.tlb
%EQUATE `STDOLE2_MAJORVERNUM = &H2
%EQUATE `STDOLE2_MINORVERNUM = &H0
%EQUATE `STDOLE2_LCID = &H0000
'/* if not already picked up from olenls.h */
'#ifndef _LCID_DEFINED
''typedef DWORD LCID;
'# define _LCID_DEFINED
'#endif
'/* pull in the MIDL generated header */
#INCLUDE ONCE "Legacy/COM/OAIdl.inc"
'/*---------------------------------------------------------------------*/
'/* BSTR API */
'/*---------------------------------------------------------------------*/
' ========================================================================================
' Note: The return type has been declared as DWORD instead of as WSTRING for compatibility
' with old code and because sometimes we need to pass a pointer to a BSTR that will be
' freed by the called function or method. Also because, otherwise, it will be useless since
' it will produce the same result that declaring DIM bstr AS WSTRING.
' ========================================================================================
DECLARE FUNCTION SysAllocString LIB "oleaut32.dll" ALIAS "SysAllocString" ( BYREF sz AS WSTRINGZ ) AS QUAD ' BSTR
' ========================================================================================
' Note: The pbstr parameter has been declared as DWORD instead of WSTRING to allow his use
' with the strings allocated using SysAllocString.
' ========================================================================================
DECLARE FUNCTION SysReAllocString LIB "oleaut32.dll" ALIAS "SysReAllocString" ( BYVAL pbstr AS QUAD , BYREF psz AS WSTRINGZ ) AS LONG ' int
' ========================================================================================
' Note: The return type has been declared as DWORD instead of as WSTRING for the reasons
' explained in the comments to the SysAllocString function.
' ========================================================================================
DECLARE FUNCTION SysAllocStringLen LIB "oleaut32.dll" ALIAS "SysAllocStringLen" ( BYREF pch AS WSTRINGZ , BYVAL cch AS QUAD ) AS QUAD ' BSTR
' ========================================================================================
' Note: The pbstr parameter has been declared as DWORD instead of WSTRING to allow his use
' with the strings allocated with SysAllocStringLen.
' ========================================================================================
DECLARE FUNCTION SysReAllocStringLen LIB "oleaut32.dll" ALIAS "SysReAllocStringLen" ( BYVAL pbstr AS QUAD , BYREF psz AS WSTRINGZ , BYVAL cch AS QUAD ) AS LONG ' int
' ========================================================================================
' Note: The bstr parameter has been declared as DWORD instead of WSTRING to allow to be
' used with strings allocated with SysAllocString or SysAllocStringLen. Also because.
' otherwise, it will be useless since strings allocated by PowerBASIC are freed automatically.
' ========================================================================================
DECLARE SUB SysFreeString LIB "oleaut32.dll" ALIAS "SysFreeString" ( BYVAL bstr AS QUAD ) ' void
' ========================================================================================
' Note: The bstr parameter has been declared as DWORD instead of WSTRING to allow his use
' with the strings allocated with SysAllocStringLen.
' ========================================================================================
DECLARE FUNCTION SysStringLen LIB "oleaut32.dll" ALIAS "SysStringLen" ( BYVAL bstr AS QUAD ) AS QUAD ' UINT
'#if (defined (_WIN32) || defined (_WIN64))
' ========================================================================================
' Note: The bstr parameter has been declared as DWORD instead of WSTRING to allow his use
' with the strings allocated with SysAllocStringByteLen.
' ========================================================================================
DECLARE FUNCTION SysStringByteLen LIB "oleaut32.dll" ALIAS "SysStringByteLen" ( BYVAL bstr AS QUAD ) AS QUAD ' UINT
' ========================================================================================
' Note: The return type has been declared as DWORD instead of as WSTRING for the reasons
' explained in the comments to the SysAllocString function.
' ========================================================================================
DECLARE FUNCTION SysAllocStringByteLen LIB "oleaut32.dll" ALIAS "SysAllocStringByteLen" ( BYREF psz AS ASCIIZ , BYVAL len AS QUAD ) AS QUAD ' BSTR
'#endif
'/*---------------------------------------------------------------------*/
'/* Time API */
'/*---------------------------------------------------------------------*/
DECLARE FUNCTION DosDateTimeToVariantTime LIB "oleaut32.dll" ALIAS "DosDateTimeToVariantTime" ( BYVAL wDosDate AS WORD , BYVAL wDosTime AS WORD , BYREF pvtime AS DOUBLE ) AS LONG ' int
DECLARE FUNCTION VariantTimeToDosDateTime LIB "oleaut32.dll" ALIAS "VariantTimeToDosDateTime" ( BYVAL vtime AS DOUBLE , BYREF pwDosDate AS WORD , BYREF pwDosTime AS WORD ) AS LONG ' int
'#if (defined (_WIN32) || defined (_WIN64))
DECLARE FUNCTION SystemTimeToVariantTime LIB "oleaut32.dll" ALIAS "SystemTimeToVariantTime" ( BYREF lpSystemTime AS SYSTEMTIME , BYREF pvtime AS DOUBLE ) AS LONG ' int
DECLARE FUNCTION VariantTimeToSystemTime LIB "oleaut32.dll" ALIAS "VariantTimeToSystemTime" ( BYVAL vtime AS DOUBLE , BYREF lpSystemTime AS SYSTEMTIME ) AS LONG ' int
'#endif
'/*---------------------------------------------------------------------*/
'/* SafeArray API */
'/*---------------------------------------------------------------------*/
DECLARE FUNCTION SafeArrayAllocDescriptor LIB "oleaut32.dll" ALIAS "SafeArrayAllocDescriptor" ( BYVAL cDims AS WORD , BYREF ppsaOut AS ANY ) AS LONG
DECLARE FUNCTION SafeArrayAllocDescriptorEx LIB "oleaut32.dll" ALIAS "SafeArrayAllocDescriptorEx" ( BYVAL vt AS WORD
 , BYVAL cDims AS WORD
 , BYREF ppsaOut AS ANY
 ) AS LONG
DECLARE FUNCTION SafeArrayAllocData LIB "oleaut32.dll" ALIAS "SafeArrayAllocData" ( BYVAL psa AS DWORD
 ) AS LONG
DECLARE FUNCTION SafeArrayCreate LIB "oleaut32.dll" ALIAS "SafeArrayCreate" ( BYVAL vt AS WORD
 , BYVAL cDims AS DWORD
 , BYREF rgsabound AS SAFEARRAYBOUND
 ) AS DWORD ' SAFEARRAY*
DECLARE FUNCTION SafeArrayCreateEx LIB "oleaut32.dll" ALIAS "SafeArrayCreateEx" ( BYVAL vt AS WORD , BYVAL cDims AS WORD , BYREF rgsabound AS SAFEARRAYBOUND , BYREF pvExtra AS ANY ) AS QUAD ' SAFEARRAY*
DECLARE FUNCTION SafeArrayCopyData LIB "oleaut32.dll" ALIAS "SafeArrayCopyData" ( BYVAL psaSource AS QUAD , BYVAL psaTarget AS QUAD ) AS LONG
DECLARE FUNCTION SafeArrayDestroyDescriptor LIB "oleaut32.dll" ALIAS "SafeArrayDestroyDescriptor" ( BYVAL psa AS QUAD
 ) AS LONG
DECLARE FUNCTION SafeArrayDestroyData LIB "oleaut32.dll" ALIAS "SafeArrayDestroyData" ( BYVAL psa AS DWORD
 ) AS LONG
DECLARE FUNCTION SafeArrayDestroy LIB "oleaut32.dll" ALIAS "SafeArrayDestroy" ( BYVAL psa AS DWORD
 ) AS LONG
DECLARE FUNCTION SafeArrayRedim LIB "oleaut32.dll" ALIAS "SafeArrayRedim" ( BYVAL psa AS DWORD
 , BYREF psaboundNew AS SAFEARRAYBOUND
 ) AS LONG
DECLARE FUNCTION SafeArrayGetDim LIB "oleaut32.dll" ALIAS "SafeArrayGetDim" ( BYVAL psa AS DWORD
 ) AS DWORD ' UINT
DECLARE FUNCTION SafeArrayGetElemsize LIB "oleaut32.dll" ALIAS "SafeArrayGetElemsize" ( BYVAL psa AS QUAD ) AS QUAD ' UINT
DECLARE FUNCTION SafeArrayGetUBound LIB "oleaut32.dll" ALIAS "SafeArrayGetUBound" ( BYVAL psa AS QUAD , BYVAL nDim AS WORD , BYREF plUbound AS LONG ) AS LONG
DECLARE FUNCTION SafeArrayGetLBound LIB "oleaut32.dll" ALIAS "SafeArrayGetLBound" ( BYVAL psa AS QUAD
 , BYVAL nDim AS WORD
 , BYREF plLbound AS LONG
 ) AS LONG
DECLARE FUNCTION SafeArrayLock LIB "oleaut32.dll" ALIAS "SafeArrayLock" ( BYVAL psa AS DWORD
 ) AS LONG
DECLARE FUNCTION SafeArrayUnlock LIB "oleaut32.dll" ALIAS "SafeArrayUnlock" ( BYVAL psa AS DWORD
 ) AS LONG
DECLARE FUNCTION SafeArrayAccessData LIB "oleaut32.dll" ALIAS "SafeArrayAccessData" ( BYVAL psa AS DWORD
 , BYREF ppvData AS ANY
 ) AS LONG
DECLARE FUNCTION SafeArrayUnaccessData LIB "oleaut32.dll" ALIAS "SafeArrayUnaccessData" ( BYVAL psa AS DWORD
 ) AS LONG
DECLARE FUNCTION SafeArrayGetElement LIB "oleaut32.dll" ALIAS "SafeArrayGetElement" ( BYVAL psa AS DWORD
 , BYREF rgIndices AS LONG
 , BYREF pv AS ANY
 ) AS LONG
DECLARE FUNCTION SafeArrayPutElement LIB "oleaut32.dll" ALIAS "SafeArrayPutElement" ( BYVAL psa AS DWORD
 , BYREF rgIndices AS LONG
 , BYREF pv AS ANY
 ) AS LONG
DECLARE FUNCTION SafeArrayCopy LIB "oleaut32.dll" ALIAS "SafeArrayCopy" ( BYVAL psa AS DWORD
 , BYREF ppsaOut AS ANY
 ) AS LONG
DECLARE FUNCTION SafeArrayPtrOfIndex LIB "oleaut32.dll" ALIAS "SafeArrayPtrOfIndex" ( BYVAL psa AS DWORD
 , BYREF rgIndices AS LONG
 , BYREF ppvData AS ANY
 ) AS LONG
DECLARE FUNCTION SafeArraySetRecordInfo LIB "oleaut32.dll" ALIAS "SafeArraySetRecordInfo" ( BYVAL psa AS DWORD
 , BYVAL psaboundNew AS IRecordInfo
 ) AS LONG
DECLARE FUNCTION SafeArrayGetRecordInfo LIB "oleaut32.dll" ALIAS "SafeArrayGetRecordInfo" ( BYVAL psa AS DWORD
 , BYREF prinfo AS IRecordInfo
 ) AS LONG
DECLARE FUNCTION SafeArraySetIID LIB "oleaut32.dll" ALIAS "SafeArraySetIID" ( BYVAL psa AS DWORD
 , BYREF pguid AS GUID
 ) AS LONG
DECLARE FUNCTION SafeArrayGetIID LIB "oleaut32.dll" ALIAS "SafeArrayGetIID" ( BYVAL psa AS DWORD
 , BYREF pguid AS GUID
 ) AS LONG
DECLARE FUNCTION SafeArrayGetVartype LIB "oleaut32.dll" ALIAS "SafeArrayGetVartype" ( BYVAL psa AS DWORD
 , BYREF pvt AS WORD
 ) AS LONG
DECLARE FUNCTION SafeArrayCreateVector LIB "oleaut32.dll" ALIAS "SafeArrayCreateVector" ( BYVAL vt AS WORD
 , BYVAL lLbound AS LONG
 , BYVAL cElements AS WORD
 ) AS DWORD ' SAFEARRAY*
DECLARE FUNCTION SafeArrayCreateVectorEx LIB "oleaut32.dll" ALIAS "SafeArrayCreateVectorEx" ( BYVAL vt AS WORD , BYVAL lLbound AS LONG , BYVAL cElements AS WORD , BYREF pvExtra AS ANY ) AS QUAD ' SAFEARRAY*
'/*---------------------------------------------------------------------*/
'/* VARIANT API */
'/*---------------------------------------------------------------------*/
' Note: Using AS ANY disables type checking, so you can pass variants declared with PB and
' variants declared as VARIANTAPI or tagVARIANT.
' * Example:
' DIM v1 as VARIANTAPI, v2 AS VARIANT
' VariantInit v1
' v2 = 12345 AS DWORD
' VariantCopy v1, v2
DECLARE SUB VariantInit LIB "oleaut32.dll" ALIAS "VariantInit" ( BYREF pvarg AS ANY ) ' void
DECLARE FUNCTION VariantClear LIB "oleaut32.dll" ALIAS "VariantClear" ( BYREF pvarg AS ANY ) AS LONG
DECLARE FUNCTION VariantCopy LIB "oleaut32.dll" ALIAS "VariantCopy" ( BYREF pvargDest AS ANY
 , BYREF pvarSrc AS ANY
 ) AS LONG
DECLARE FUNCTION VariantCopyInd LIB "oleaut32.dll" ALIAS "VariantCopyInd" ( BYREF pvarg AS ANY
 , BYREF pvarSrc AS ANY
 ) AS LONG
DECLARE FUNCTION VariantChangeType LIB "oleaut32.dll" ALIAS "VariantChangeType" ( BYREF pvargDest AS ANY
 , BYREF pvarSrc AS ANY
 , BYVAL wFlags AS WORD
 , BYVAL vt AS WORD
 ) AS LONG
DECLARE FUNCTION VariantChangeTypeEx LIB "oleaut32.dll" ALIAS "VariantChangeTypeEx" ( BYREF pvargDest AS ANY
 , BYREF pvarSrc AS ANY
 , BYVAL lcid AS DWORD
 , BYVAL wFlags AS WORD
 , BYVAL vt AS WORD
 ) AS LONG
'// Flags for VariantChangeType/VariantChangeTypeEx
'#define VARIANT_NOVALUEPROP 0x01
'#define VARIANT_ALPHABOOL 0x02 // For VT_BOOL to VT_BSTR conversions,
' // convert to "True"/"False" instead of
' // "-1"/"0"
'#define VARIANT_NOUSEROVERRIDE 0x04 // For conversions to/from VT_BSTR,
' // passes LOCALE_NOUSEROVERRIDE
' // to core coercion routines
'#define VARIANT_CALENDAR_HIJRI 0x08
'#define VARIANT_LOCALBOOL 0x10 // For VT_BOOL to VT_BSTR and back,
' // convert to local language rather than
' // English
'#define VARIANT_CALENDAR_THAI 0x20 // SOUTHASIA calendar support
'#define VARIANT_CALENDAR_GREGORIAN 0x40 // SOUTHASIA calendar support
'#define VARIANT_USE_NLS 0x80 // NLS function call support
%EQUATE `VARIANT_NOVALUEPROP = &H01
%EQUATE `VARIANT_ALPHABOOL = &H02
%EQUATE `VARIANT_NOUSEROVERRIDE = &H04
%EQUATE `VARIANT_CALENDAR_HIJRI = &H08
%EQUATE `VARIANT_LOCALBOOL = &H10
%EQUATE `VARIANT_CALENDAR_THAI = &H20 ' // SOUTHASIA calendar support
%EQUATE `VARIANT_CALENDAR_GREGORIAN = &H40 ' // SOUTHASIA calendar support
%EQUATE `VARIANT_USE_NLS = &H80 ' // NLS function call support
'/*---------------------------------------------------------------------*/
'/* Vector <-> Bstr conversion APIs */
'/*---------------------------------------------------------------------*/
DECLARE FUNCTION BstrFromVector LIB "oleaut32.dll" ALIAS "BstrFromVector" ( BYVAL psa AS QUAD , BYREF pbstr AS WSTRING ) AS LONG
DECLARE FUNCTION VectorFromBstr LIB "oleaut32.dll" ALIAS "VectorFromBstr" ( BYVAL bstr AS WSTRING
 , BYREF ppsa AS ANY
 ) AS LONG
'/*---------------------------------------------------------------------*/
'/* Variant API Flags */
'/*---------------------------------------------------------------------*/
'/* Any of the coersion functions that converts either from or to a string
' * takes an additional lcid and dwFlags arguments. The lcid argument allows
' * locale specific parsing to occur. The dwFlags allow additional function
' * specific condition to occur. All function that accept the dwFlags argument
' * can include either 0 or LOCALE_NOUSEROVERRIDE flag.
' */
'/* The VarDateFromStr and VarBstrFromDate functions also accept the
' * VAR_TIMEVALUEONLY and VAR_DATEVALUEONLY flags
' */
'#define VAR_TIMEVALUEONLY ((DWORD)0x00000001) /* return time value */
'#define VAR_DATEVALUEONLY ((DWORD)0x00000002) /* return date value */
%EQUATE `VAR_TIMEVALUEONLY = &H00000001 ' /* return time value */
%EQUATE `VAR_DATEVALUEONLY = &H00000002 ' /* return date value */
'/* VarDateFromUdate() only */
'#define VAR_VALIDDATE ((DWORD)0x00000004)
%EQUATE `VAR_VALIDDATE = &H00000004
'/* Accepted by all date & format APIs */
'#define VAR_CALENDAR_HIJRI ((DWORD)0x00000008) /* use Hijri calender */
%EQUATE `VAR_CALENDAR_HIJRI = &H00000008 ' /* use Hijri calender */
'/* Booleans can optionally be accepted in localized form. Pass VAR_LOCALBOOL
' * into VarBoolFromStr and VarBstrFromBool to use localized boolean names
' */
'#define VAR_LOCALBOOL ((DWORD)0x00000010)
%EQUATE `VAR_LOCALBOOL = &H00000010
'/* When passed into VarFormat and VarFormatFromTokens, prevents substitution
' * of formats in the case where a string is passed in that can not be
' * coverted into the desired type. (for ex, 'Format("Hello", "General Number")')
' */
'#define VAR_FORMAT_NOSUBSTITUTE ((DWORD)0x00000020)
%EQUATE `VAR_FORMAT_NOSUBSTITUTE = &H00000020
'/*
' * For VarBstrFromDate only - forces years to be 4 digits rather than shortening
' * to 2-digits when the years is in the date window.
' */
'#define VAR_FOURDIGITYEARS ((DWORD)0x00000040)
%EQUATE `VAR_FOURDIGITYEARS = &H00000040
'/*
' * Use NLS functions to format date, currency, time, and number.
' */
#IF NOT %DEF(%LOCALE_USE_NLS)
%EQUATE `LOCALE_USE_NLS = &H10000000
#ENDIF
'// SOUTHASIA START
'/* SOUTHASIA
' * For VarBstrFromDate only - forces years to be 4 digits rather than shortening
' * to 2-digits when the years is in the date window.
' */
'#define VAR_CALENDAR_THAI ((DWORD)0x00000080)
'#define VAR_CALENDAR_GREGORIAN ((DWORD)0x00000100)
%EQUATE `VAR_CALENDAR_THAI = &H00000080
%EQUATE `VAR_CALENDAR_GREGORIAN = &H00000100
'//SOUTHASIA END
%EQUATE `VTDATEGRE_MAX = 2958465 ' /* Dec 31, 9999, 0:0:0 in Gregorain Calendar */
%EQUATE `VTDATEGRE_MIN = -657434 ' /* Jan 1, 100, 0:0:0 in Gregorain Calendar */
'/*---------------------------------------------------------------------*/
'/* VARTYPE Coercion API */
'/*---------------------------------------------------------------------*/
'/* Note: The routines that convert *from* a string are defined
' * to take a OLECHAR* rather than a BSTR because no allocation is
' * required, and this makes the routines a bit more generic.
' * They may of course still be passed a BSTR as the strIn param.
' */
DECLARE FUNCTION VarUI1FromI2 LIB "oleaut32.dll" ALIAS "VarUI1FromI2" ( BYVAL sIn AS INTEGER , BYREF pbOut AS BYTE ) AS LONG
DECLARE FUNCTION VarUI1FromI4 LIB "oleaut32.dll" ALIAS "VarUI1FromI4" ( BYVAL lIn AS LONG
 , BYREF pbOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarUI1FromI8 LIB "oleaut32.dll" ALIAS "VarUI1FromI8" ( BYVAL i64In AS QUAD
 , BYREF pbOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarUI1FromR4 LIB "oleaut32.dll" ALIAS "VarUI1FromR4" ( BYVAL fltIn AS SINGLE
 , BYREF pbOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarUI1FromR8 LIB "oleaut32.dll" ALIAS "VarUI1FromR8" ( BYVAL dblIn AS DOUBLE
 , BYREF pbOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarUI1FromCy LIB "oleaut32.dll" ALIAS "VarUI1FromCy" ( BYVAL cyIn AS CUR
 , BYREF pbOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarUI1FromDate LIB "oleaut32.dll" ALIAS "VarUI1FromDate" ( BYVAL dateIn AS DOUBLE
 , BYREF pbOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarUI1FromStr LIB "oleaut32.dll" ALIAS "VarUI1FromStr" ( BYREF strIn AS WSTRINGZ
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarUI1FromDisp LIB "oleaut32.dll" ALIAS "VarUI1FromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYREF pbOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarUI1FromBool LIB "oleaut32.dll" ALIAS "VarUI1FromBool" ( BYVAL boolIn AS INTEGER
 , BYREF pbOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarUI1FromI1 LIB "oleaut32.dll" ALIAS "VarUI1FromI1" ( BYVAL cIn AS BYTE
 , BYREF pbOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarUI1FromUI2 LIB "oleaut32.dll" ALIAS "VarUI1FromUI2" ( BYVAL uiIn AS WORD
 , BYREF pbOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarUI1FromUI4 LIB "oleaut32.dll" ALIAS "VarUI1FromUI4" ( BYVAL ulIn AS DWORD
 , BYREF pbOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarUI1FromUI8 LIB "oleaut32.dll" ALIAS "VarUI1FromUI8" ( BYVAL ui64In AS QUAD
 , BYREF pbOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarUI1FromDec LIB "oleaut32.dll" ALIAS "VarUI1FromDec" ( BYREF pdecIn AS ANY
 , BYREF pbOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI2FromUI1 LIB "oleaut32.dll" ALIAS "VarI2FromUI1" ( BYVAL bIn AS BYTE
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI2FromI4 LIB "oleaut32.dll" ALIAS "VarI2FromI4" ( BYVAL lIn AS LONG
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI2FromI8 LIB "oleaut32.dll" ALIAS "VarI2FromI8" ( BYVAL i64In AS QUAD
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI2FromR4 LIB "oleaut32.dll" ALIAS "VarI2FromR4" ( BYVAL fltIn AS SINGLE
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI2FromR8 LIB "oleaut32.dll" ALIAS "VarI2FromR8" ( BYVAL dblIn AS DOUBLE
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI2FromCy LIB "oleaut32.dll" ALIAS "VarI2FromCy" ( BYVAL cyIn AS CUR
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI2FromDate LIB "oleaut32.dll" ALIAS "VarI2FromDate" ( BYVAL dateIn AS DOUBLE
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI2FromStr LIB "oleaut32.dll" ALIAS "VarI2FromStr" ( BYREF strIn AS WSTRINGZ
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI2FromDisp LIB "oleaut32.dll" ALIAS "VarI2FromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI2FromBool LIB "oleaut32.dll" ALIAS "VarI2FromBool" ( BYVAL boolIn AS INTEGER
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI2FromI1 LIB "oleaut32.dll" ALIAS "VarI2FromI1" ( BYVAL cIn AS BYTE
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI2FromUI2 LIB "oleaut32.dll" ALIAS "VarI2FromUI2" ( BYVAL uiIn AS WORD
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI2FromUI4 LIB "oleaut32.dll" ALIAS "VarI2FromUI4" ( BYVAL ulIn AS DWORD
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI2FromUI8 LIB "oleaut32.dll" ALIAS "VarI2FromUI8" ( BYVAL ui64In AS QUAD
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI2FromDec LIB "oleaut32.dll" ALIAS "VarI2FromDec" ( BYREF pdecIn AS ANY
 , BYREF psOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI4FromUI1 LIB "oleaut32.dll" ALIAS "VarI4FromUI1" ( BYVAL bIn AS BYTE
 , BYREF plOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromI2 LIB "oleaut32.dll" ALIAS "VarI4FromI2" ( BYVAL sIn AS INTEGER
 , BYREF plOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromI8 LIB "oleaut32.dll" ALIAS "VarI4FromI8" ( BYVAL i64In AS QUAD
 , BYREF plOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromR4 LIB "oleaut32.dll" ALIAS "VarI4FromR4" ( BYVAL fltIn AS SINGLE
 , BYREF plOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromR8 LIB "oleaut32.dll" ALIAS "VarI4FromR8" ( BYVAL dblIn AS DOUBLE
 , BYREFplOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromCy LIB "oleaut32.dll" ALIAS "VarI4FromCy" ( BYVAL cyIn AS CUR
 , BYREF plOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromDate LIB "oleaut32.dll" ALIAS "VarI4FromDate" ( BYVAL dateIn AS DOUBLE
 , BYREF plOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromStr LIB "oleaut32.dll" ALIAS "VarI4FromStr" ( BYREF strIn AS WSTRINGZ
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF plOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromDisp LIB "oleaut32.dll" ALIAS "VarI4FromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYREF plOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromBool LIB "oleaut32.dll" ALIAS "VarI4FromBool" ( BYVAL boolIn AS INTEGER
 , BYREF plOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromI1 LIB "oleaut32.dll" ALIAS "VarI4FromI1" ( BYVAL cIn AS BYTE
 , BYREF plOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromUI2 LIB "oleaut32.dll" ALIAS "VarI4FromUI2" ( BYVAL uiIn AS WORD
 , BYREF plOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromUI4 LIB "oleaut32.dll" ALIAS "VarI4FromUI4" ( BYVAL ulIn AS DWORD
 , BYREF plOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromUI8 LIB "oleaut32.dll" ALIAS "VarI4FromUI8" ( BYVAL ui64In AS QUAD
 , BYREF plOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromDec LIB "oleaut32.dll" ALIAS "VarI4FromDec" ( BYREF pdecIn AS ANY
 , BYREF plOut AS LONG
 ) AS LONG
DECLARE FUNCTION VarI4FromInt LIB "oleaut32.dll" ALIAS "VarI4FromInt" ( BYVAL intIn AS LONG
 , BYREF plOut AS LONG
 ) AS LONG
'/******************************************/
DECLARE FUNCTION VarI8FromUI1 LIB "oleaut32.dll" ALIAS "VarI8FromUI1" ( BYVAL bIn AS BYTE , BYREF pi64Out AS QUAD ) AS LONG
DECLARE FUNCTION VarI8FromI2 LIB "oleaut32.dll" ALIAS "VarI8FromI2" ( BYVAL sIn AS INTEGER
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarI8FromI4 LIB "oleaut32.dll" ALIAS "VarI8FromI4" ( BYVAL lIn AS LONG
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarI8FromR4 LIB "oleaut32.dll" ALIAS "VarI8FromR4" ( BYVAL fltIn AS SINGLE
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarI8FromR8 LIB "oleaut32.dll" ALIAS "VarI8FromR8" ( BYVAL dblIn AS DOUBLE
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarI8FromCy LIB "oleaut32.dll" ALIAS "VarI8FromCy" ( BYVAL cyIn AS CUR
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarI8FromDate LIB "oleaut32.dll" ALIAS "VarI8FromDate" ( BYVAL dateIn AS DOUBLE
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarI8FromStr LIB "oleaut32.dll" ALIAS "VarI8FromStr" ( BYREF strIn AS WSTRINGZ
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarI8FromDisp LIB "oleaut32.dll" ALIAS "VarI8FromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarI8FromBool LIB "oleaut32.dll" ALIAS "VarI8FromBool" ( BYVAL boolIn AS INTEGER
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarI8FromI1 LIB "oleaut32.dll" ALIAS "VarI8FromI1" ( BYVAL cIn AS BYTE
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarI8FromUI2 LIB "oleaut32.dll" ALIAS "VarI8FromUI2" ( BYVAL uiIn AS WORD
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarI8FromUI4 LIB "oleaut32.dll" ALIAS "VarI8FromUI4" ( BYVAL ulIn AS DWORD
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarI8FromUI8 LIB "oleaut32.dll" ALIAS "VarI8FromUI8" ( BYVAL ui64In AS QUAD
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarI8FromDec LIB "oleaut32.dll" ALIAS "VarI8FromDec" ( BYREF pdecIn AS ANY
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarI8FromInt LIB "oleaut32.dll" ALIAS "VarI8FromInt" ( BYVAL intIn AS LONG
 , BYREF pi64Out AS QUAD
 ) AS LONG
'/*********************/
DECLARE FUNCTION VarR4FromUI1 LIB "oleaut32.dll" ALIAS "VarR4FromUI1" ( BYVAL bIn AS BYTE , BYREF pfltOut AS SINGLE ) AS LONG
DECLARE FUNCTION VarR4FromI2 LIB "oleaut32.dll" ALIAS "VarR4FromI2" ( BYVAL sIn AS INTEGER
 , BYREF pfltOut AS SINGLE
 ) AS LONG
DECLARE FUNCTION VarR4FromI4 LIB "oleaut32.dll" ALIAS "VarR4FromI4" ( BYVAL lIn AS LONG
 , BYREF pfltOut AS SINGLE
 ) AS LONG
DECLARE FUNCTION VarR4FromI8 LIB "oleaut32.dll" ALIAS "VarR4FromI8" ( BYVAL i64In AS QUAD
 , BYREF pfltOut AS SINGLE
 ) AS LONG
DECLARE FUNCTION VarR4FromR8 LIB "oleaut32.dll" ALIAS "VarR4FromR8" ( BYVAL dblIn AS DOUBLE
 , BYREF pfltOut AS SINGLE
 ) AS LONG
DECLARE FUNCTION VarR4FromCy LIB "oleaut32.dll" ALIAS "VarR4FromCy" ( BYVAL cyIn AS CUR
 , BYREF pfltOut AS SINGLE
 ) AS LONG
DECLARE FUNCTION VarR4FromDate LIB "oleaut32.dll" ALIAS "VarR4FromDate" ( BYVAL dateIn AS DOUBLE
 , BYREF pfltOut AS SINGLE
 ) AS LONG
DECLARE FUNCTION VarR4FromStr LIB "oleaut32.dll" ALIAS "VarR4FromStr" ( BYREF strIn AS WSTRINGZ
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pfltOut AS SINGLE
 ) AS LONG
DECLARE FUNCTION VarR4FromDisp LIB "oleaut32.dll" ALIAS "VarR4FromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYREF pfltOut AS SINGLE
 ) AS LONG
DECLARE FUNCTION VarR4FromBool LIB "oleaut32.dll" ALIAS "VarR4FromBool" ( BYVAL boolIn AS INTEGER
 , BYREF pfltOut AS SINGLE
 ) AS LONG
DECLARE FUNCTION VarR4FromI1 LIB "oleaut32.dll" ALIAS "VarR4FromI1" ( BYVAL cIn AS BYTE
 , BYREF pfltOut AS SINGLE
 ) AS LONG
DECLARE FUNCTION VarR4FromUI2 LIB "oleaut32.dll" ALIAS "VarR4FromUI2" ( BYVAL uiIn AS WORD
 , BYREF pfltOut AS SINGLE
 ) AS LONG
DECLARE FUNCTION VarR4FromUI4 LIB "oleaut32.dll" ALIAS "VarR4FromUI4" ( BYVAL ulIn AS DWORD
 , BYREF pfltOut AS SINGLE
 ) AS LONG
DECLARE FUNCTION VarR4FromUI8 LIB "oleaut32.dll" ALIAS "VarR4FromUI8" ( BYVAL ui64In AS QUAD
 , BYREF pfltOut AS SINGLE
 ) AS LONG
DECLARE FUNCTION VarR4FromDec LIB "oleaut32.dll" ALIAS "VarR4FromDec" ( BYREF pdecIn AS ANY
 , BYREF pfltOut AS SINGLE
 ) AS LONG
DECLARE FUNCTION VarR8FromUI1 LIB "oleaut32.dll" ALIAS "VarR8FromUI1" ( BYVAL bIn AS BYTE
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8FromI2 LIB "oleaut32.dll" ALIAS "VarR8FromI2" ( BYVAL sIn AS INTEGER
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8FromI4 LIB "oleaut32.dll" ALIAS "VarR8FromI4" ( BYVAL lIn AS LONG
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8FromI8 LIB "oleaut32.dll" ALIAS "VarR8FromI8" ( BYVAL i64In AS QUAD
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8FromR4 LIB "oleaut32.dll" ALIAS "VarR8FromR4" ( BYVAL fltIn AS SINGLE
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8FromCy LIB "oleaut32.dll" ALIAS "VarR8FromCy" ( BYVAL cyIn AS CUR
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8FromDate LIB "oleaut32.dll" ALIAS "VarR8FromDate" ( BYVAL dateIn AS DOUBLE
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8FromStr LIB "oleaut32.dll" ALIAS "VarR8FromStr" ( BYREF strIn AS WSTRINGZ
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8FromDisp LIB "oleaut32.dll" ALIAS "VarR8FromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8FromBool LIB "oleaut32.dll" ALIAS "VarR8FromBool" ( BYVAL boolIn AS INTEGER
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8FromI1 LIB "oleaut32.dll" ALIAS "VarR8FromI1" ( BYVAL cIn AS BYTE
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8FromUI2 LIB "oleaut32.dll" ALIAS "VarR8FromUI2" ( BYVAL uiIn AS WORD
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8FromUI4 LIB "oleaut32.dll" ALIAS "VarR8FromUI4" ( BYVAL ulIn AS DWORD
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8FromUI8 LIB "oleaut32.dll" ALIAS "VarR8FromUI8" ( BYVAL ui64In AS QUAD
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8FromDec LIB "oleaut32.dll" ALIAS "VarR8FromDec" ( BYREF pdecIn AS ANY
 , BYREF pdblOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromUI1 LIB "oleaut32.dll" ALIAS "VarDateFromUI1" ( BYVAL bIn AS BYTE
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromI2 LIB "oleaut32.dll" ALIAS "VarDateFromI2" ( BYVAL sIn AS INTEGER
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromI4 LIB "oleaut32.dll" ALIAS "VarDateFromI4" ( BYVAL lIn AS LONG
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromI8 LIB "oleaut32.dll" ALIAS "VarDateFromI8" ( BYVAL i64In AS QUAD
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromR4 LIB "oleaut32.dll" ALIAS "VarDateFromR4" ( BYVAL fltIn AS SINGLE
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromR8 LIB "oleaut32.dll" ALIAS "VarDateFromR8" ( BYVAL dblIn AS DOUBLE
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromCy LIB "oleaut32.dll" ALIAS "VarDateFromCy" ( BYVAL cyIn AS CUR
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromStr LIB "oleaut32.dll" ALIAS "VarDateFromStr" ( BYREF strIn AS WSTRINGZ
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromDisp LIB "oleaut32.dll" ALIAS "VarDateFromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromBool LIB "oleaut32.dll" ALIAS "VarDateFromBool" ( BYVAL boolIn AS INTEGER
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromI1 LIB "oleaut32.dll" ALIAS "VarDateFromI1" ( BYVAL cIn AS BYTE
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromUI2 LIB "oleaut32.dll" ALIAS "VarDateFromUI2" ( BYVAL uiIn AS WORD
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromUI4 LIB "oleaut32.dll" ALIAS "VarDateFromUI4" ( BYVAL ulIn AS DWORD
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromUI8 LIB "oleaut32.dll" ALIAS "VarDateFromUI8" ( BYVAL ui64In AS QUAD
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarDateFromDec LIB "oleaut32.dll" ALIAS "VarDateFromDec" ( BYREF pdecIn AS ANY
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarCyFromUI1 LIB "oleaut32.dll" ALIAS "VarCyFromUI1" ( BYVAL bIn AS BYTE
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFromI2 LIB "oleaut32.dll" ALIAS "VarCyFromI2" ( BYVAL sIn AS INTEGER
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFromI4 LIB "oleaut32.dll" ALIAS "VarCyFromI4" ( BYVAL lIn AS LONG
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFromI8 LIB "oleaut32.dll" ALIAS "VarCyFromI8" ( BYVAL i64In AS QUAD
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFromR4 LIB "oleaut32.dll" ALIAS "VarCyFromR4" ( BYVAL fltIn AS SINGLE
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFromR8 LIB "oleaut32.dll" ALIAS "VarCyFromR8" ( BYVAL dblIn AS DOUBLE
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFromDate LIB "oleaut32.dll" ALIAS "VarCyFromDate" ( BYVAL dateIn AS DOUBLE
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFromStr LIB "oleaut32.dll" ALIAS "VarCyFromStr" ( BYREF strIn AS WSTRINGZ
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFromDisp LIB "oleaut32.dll" ALIAS "VarCyFromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFromBool LIB "oleaut32.dll" ALIAS "VarCyFromBool" ( BYVAL boolIn AS INTEGER
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFromI1 LIB "oleaut32.dll" ALIAS "VarCyFromI1" ( BYVAL cIn AS BYTE
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFromUI2 LIB "oleaut32.dll" ALIAS "VarCyFromUI2" ( BYVAL uiIn AS DWORD
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFromUI4 LIB "oleaut32.dll" ALIAS "VarCyFromUI4" ( BYVAL ulIn AS DWORD
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFromUI8 LIB "oleaut32.dll" ALIAS "VarCyFromUI8" ( BYVAL ui64In AS QUAD
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFromDec LIB "oleaut32.dll" ALIAS "VarCyFromDec" ( BYREF pdecIn AS ANY
 , BYREF pcyOut AS CUR
 ) AS LONG
DECLARE FUNCTION VarBstrFromUI1 LIB "oleaut32.dll" ALIAS "VarBstrFromUI1" ( BYVAL bVal AS BYTE
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBstrFromI2 LIB "oleaut32.dll" ALIAS "VarBstrFromI2" ( BYVAL iVal AS INTEGER
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBstrFromI4 LIB "oleaut32.dll" ALIAS "VarBstrFromI4" ( BYVAL lIn AS LONG
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBstrFromI8 LIB "oleaut32.dll" ALIAS "VarBstrFromI8" ( BYVAL i64In AS QUAD
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBstrFromR4 LIB "oleaut32.dll" ALIAS "VarBstrFromR4" ( BYVAL fltIn AS SINGLE
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBstrFromR8 LIB "oleaut32.dll" ALIAS "VarBstrFromR8" ( BYVAL dblIn AS DOUBLE
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBstrFromCy LIB "oleaut32.dll" ALIAS "VarBstrFromCy" ( BYVAL cyIn AS CUR
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBstrFromDate LIB "oleaut32.dll" ALIAS "VarBstrFromDate" ( BYVAL dateIn AS DOUBLE
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBstrFromDisp LIB "oleaut32.dll" ALIAS "VarBstrFromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBstrFromBool LIB "oleaut32.dll" ALIAS "VarBstrFromBool" ( BYVAL boolIn AS INTEGER
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBstrFromI1 LIB "oleaut32.dll" ALIAS "VarBstrFromI1" ( BYVAL cIn AS BYTE
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBstrFromUI2 LIB "oleaut32.dll" ALIAS "VarBstrFromUI2" ( BYVAL uiIn AS WORD
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBstrFromUI4 LIB "oleaut32.dll" ALIAS "VarBstrFromUI4" ( BYVAL ulIn AS DWORD
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBstrFromUI8 LIB "oleaut32.dll" ALIAS "VarBstrFromUI8" ( BYVAL ui64In AS QUAD
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBstrFromDec LIB "oleaut32.dll" ALIAS "VarBstrFromDec" ( BYREF pdecIn AS ANY
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarBoolFromUI1 LIB "oleaut32.dll" ALIAS "VarBoolFromUI1" ( BYVAL bIn AS BYTE
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarBoolFromI2 LIB "oleaut32.dll" ALIAS "VarBoolFromI2" ( BYVAL sIn AS WORD
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarBoolFromI4 LIB "oleaut32.dll" ALIAS "VarBoolFromI4" ( BYVAL lIn AS LONG
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarBoolFromI8 LIB "oleaut32.dll" ALIAS "VarBoolFromI8" ( BYVAL i64In AS QUAD
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarBoolFromR4 LIB "oleaut32.dll" ALIAS "VarBoolFromR4" ( BYVAL fltIn AS SINGLE
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarBoolFromR8 LIB "oleaut32.dll" ALIAS "VarBoolFromR8" ( BYVAL dblIn AS DOUBLE
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarBoolFromDate LIB "oleaut32.dll" ALIAS "VarBoolFromDate" ( BYVAL dateIn AS DOUBLE
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarBoolFromCy LIB "oleaut32.dll" ALIAS "VarBoolFromCy" ( BYVAL cyIn AS CUR
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarBoolFromStr LIB "oleaut32.dll" ALIAS "VarBoolFromStr" ( BYREF strIn AS WSTRINGZ
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarBoolFromDisp LIB "oleaut32.dll" ALIAS "VarBoolFromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarBoolFromI1 LIB "oleaut32.dll" ALIAS "VarBoolFromI1" ( BYVAL cIn AS BYTE
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarBoolFromUI2 LIB "oleaut32.dll" ALIAS "VarBoolFromUI2" ( BYVAL uiIn AS WORD
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarBoolFromUI4 LIB "oleaut32.dll" ALIAS "VarBoolFromUI4" ( BYVAL ulIn AS DWORD
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarBoolFromUI8 LIB "oleaut32.dll" ALIAS "VarBoolFromUI8" ( BYVAL i64In AS QUAD
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarBoolFromDec LIB "oleaut32.dll" ALIAS "VarBoolFromDec" ( BYREF pdecIn AS ANY
 , BYREF pboolOut AS INTEGER
 ) AS LONG
DECLARE FUNCTION VarI1FromUI1 LIB "oleaut32.dll" ALIAS "VarI1FromUI1" ( BYVAL bIn AS BYTE
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI1FromI2 LIB "oleaut32.dll" ALIAS "VarI1FromI2" ( BYVAL uiIn AS INTEGER
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI1FromI4 LIB "oleaut32.dll" ALIAS "VarI1FromI4" ( BYVAL lIn AS LONG
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI1FromI8 LIB "oleaut32.dll" ALIAS "VarI1FromI8" ( BYVAL i64In AS QUAD
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI1FromR4 LIB "oleaut32.dll" ALIAS "VarI1FromR4" ( BYVAL fltIn AS SINGLE
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI1FromR8 LIB "oleaut32.dll" ALIAS "VarI1FromR8" ( BYVAL dblIn AS DOUBLE
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI1FromDate LIB "oleaut32.dll" ALIAS "VarI1FromDate" ( BYVAL dateIn AS DOUBLE
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI1FromCy LIB "oleaut32.dll" ALIAS "VarI1FromCy" ( BYVAL cyIn AS CUR
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI1FromStr LIB "oleaut32.dll" ALIAS "VarI1FromStr" ( BYREF strIn AS WSTRINGZ
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI1FromDisp LIB "oleaut32.dll" ALIAS "VarI1FromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI1FromBool LIB "oleaut32.dll" ALIAS "VarI1FromBool" ( BYVAL boolIn AS INTEGER
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI1FromUI2 LIB "oleaut32.dll" ALIAS "VarI1FromUI2" ( BYVAL uiIn AS WORD
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI1FromUI4 LIB "oleaut32.dll" ALIAS "VarI1FromUI4" ( BYVAL ulIn AS DWORD
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI1FromUI8 LIB "oleaut32.dll" ALIAS "VarI1FromUI8" ( BYVAL i64In AS QUAD
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarI1FromDec LIB "oleaut32.dll" ALIAS "VarI1FromDec" ( BYREF pdecIn AS ANY
 , BYREF pcOut AS BYTE
 ) AS LONG
DECLARE FUNCTION VarUI2FromUI1 LIB "oleaut32.dll" ALIAS "VarUI2FromUI1" ( BYVAL bIn AS BYTE
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI2FromI2 LIB "oleaut32.dll" ALIAS "VarUI2FromI2" ( BYVAL uiIn AS INTEGER
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI2FromI4 LIB "oleaut32.dll" ALIAS "VarUI2FromI4" ( BYVAL lIn AS LONG
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI2FromI8 LIB "oleaut32.dll" ALIAS "VarUI2FromI8" ( BYVAL i64In AS QUAD
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI2FromR4 LIB "oleaut32.dll" ALIAS "VarUI2FromR4" ( BYVAL fltIn AS SINGLE
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI2FromR8 LIB "oleaut32.dll" ALIAS "VarUI2FromR8" ( BYVAL dblIn AS DOUBLE
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI2FromDate LIB "oleaut32.dll" ALIAS "VarUI2FromDate" ( BYVAL dateIn AS DOUBLE
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI2FromCy LIB "oleaut32.dll" ALIAS "VarUI2FromCy" ( BYVAL cyIn AS CUR
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI2FromStr LIB "oleaut32.dll" ALIAS "VarUI2FromStr" ( BYREF strIn AS WSTRINGZ
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI2FromDisp LIB "oleaut32.dll" ALIAS "VarUI2FromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI2FromBool LIB "oleaut32.dll" ALIAS "VarUI2FromBool" ( BYVAL boolIn AS INTEGER
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI2FromI1 LIB "oleaut32.dll" ALIAS "VarUI2FromI1" ( BYVAL cIn AS BYTE
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI2FromUI4 LIB "oleaut32.dll" ALIAS "VarUI2FromUI4" ( BYVAL ulIn AS DWORD
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI2FromUI8 LIB "oleaut32.dll" ALIAS "VarUI2FromUI8" ( BYVAL i64In AS QUAD
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI2FromDec LIB "oleaut32.dll" ALIAS "VarUI2FromDec" ( BYREF pdecIn AS ANY
 , BYREF puiOut AS WORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromUI1 LIB "oleaut32.dll" ALIAS "VarUI4FromUI1" ( BYVAL bIn AS BYTE
 , BYREF pulOut AS DWORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromI2 LIB "oleaut32.dll" ALIAS "VarUI4FromI2" ( BYVAL uiIn AS INTEGER
 , BYREF pulOut AS DWORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromI4 LIB "oleaut32.dll" ALIAS "VarUI4FromI4" ( BYVAL lIn AS LONG
 , BYREF pulOut AS DWORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromI8 LIB "oleaut32.dll" ALIAS "VarUI4FromI8" ( BYVAL i64In AS QUAD
 , BYREF pulOut AS DWORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromR4 LIB "oleaut32.dll" ALIAS "VarUI4FromR4" ( BYVAL fltIn AS SINGLE
 , BYREF pulOut AS DWORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromR8 LIB "oleaut32.dll" ALIAS "VarUI4FromR8" ( BYVAL dblIn AS DOUBLE
 , BYREF pulOut AS DWORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromDate LIB "oleaut32.dll" ALIAS "VarUI4FromDate" ( BYVAL dateIn AS DOUBLE
 , BYREF pulOut AS DWORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromCy LIB "oleaut32.dll" ALIAS "VarUI4FromCy" ( BYVAL cyIn AS CUR
 , BYREF pulOut AS DWORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromStr LIB "oleaut32.dll" ALIAS "VarUI4FromStr" ( BYREF strIn AS WSTRINGZ
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pulOut AS DWORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromDisp LIB "oleaut32.dll" ALIAS "VarUI4FromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYREF pulOut AS DWORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromBool LIB "oleaut32.dll" ALIAS "VarUI4FromBool" ( BYVAL boolIn AS INTEGER
 , BYREF pulOut AS DWORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromI1 LIB "oleaut32.dll" ALIAS "VarUI4FromI1" ( BYVAL cIn AS BYTE
 , BYREF pulOut AS DWORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromUI2 LIB "oleaut32.dll" ALIAS "VarUI4FromUI2" ( BYVAL uiIn AS WORD
 , BYREF pulOut AS DWORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromUI8 LIB "oleaut32.dll" ALIAS "VarUI4FromUI8" ( BYVAL ui64In AS QUAD
 , BYREF pulOut AS DWORD
 ) AS LONG
DECLARE FUNCTION VarUI4FromDec LIB "oleaut32.dll" ALIAS "VarUI4FromDec" ( BYREF pdecIn AS ANY
 , BYREF pulOut AS DWORD
 ) AS LONG
'/******************************************/
DECLARE FUNCTION VarUI8FromUI1 LIB "oleaut32.dll" ALIAS "VarUI8FromUI1" ( BYVAL bIn AS BYTE , BYREF pi64Out AS QUAD ) AS LONG
DECLARE FUNCTION VarUI8FromI2 LIB "oleaut32.dll" ALIAS "VarUI8FromI2" ( BYVAL sIn AS INTEGER
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarUI8FromI4 LIB "oleaut32.dll" ALIAS "VarUI8FromI4" ( BYVAL lIn AS LONG
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarUI8FromI8 LIB "oleaut32.dll" ALIAS "VarUI8FromI8" ( BYVAL ui64In AS QUAD
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarUI8FromR4 LIB "oleaut32.dll" ALIAS "VarUI8FromR4" ( BYVAL fltIn AS SINGLE
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarUI8FromR8 LIB "oleaut32.dll" ALIAS "VarUI8FromR8" ( BYVAL dblIn AS DOUBLE
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarUI8FromCy LIB "oleaut32.dll" ALIAS "VarUI8FromCy" ( BYVAL cyIn AS CUR
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarUI8FromDate LIB "oleaut32.dll" ALIAS "VarUI8FromDate" ( BYVAL dateIn AS DOUBLE
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarUI8FromStr LIB "oleaut32.dll" ALIAS "VarUI8FromStr" ( BYREF strIn AS WSTRINGZ
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarUI8FromDisp LIB "oleaut32.dll" ALIAS "VarUI8FromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarUI8FromBool LIB "oleaut32.dll" ALIAS "VarUI8FromBool" ( BYVAL boolIn AS INTEGER
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarUI8FromI1 LIB "oleaut32.dll" ALIAS "VarUI8FromI1" ( BYVAL cIn AS BYTE
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarUI8FromUI2 LIB "oleaut32.dll" ALIAS "VarUI8FromUI2" ( BYVAL uiIn AS WORD
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarUI8FromUI4 LIB "oleaut32.dll" ALIAS "VarUI8FromUI4" ( BYVAL ulIn AS DWORD
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarUI8FromDec LIB "oleaut32.dll" ALIAS "VarUI8FromDec" ( BYREF pdecIn AS ANY
 , BYREF pi64Out AS QUAD
 ) AS LONG
DECLARE FUNCTION VarUI8FromInt LIB "oleaut32.dll" ALIAS "VarUI8FromInt" ( BYVAL intIn AS LONG
 , BYREF pi64Out AS QUAD
 ) AS LONG
'/*********************/
DECLARE FUNCTION VarDecFromUI1 LIB "oleaut32.dll" ALIAS "VarDecFromUI1" ( BYVAL bIn AS BYTE , BYREF pdecOut AS ANY ) AS LONG
DECLARE FUNCTION VarDecFromI2 LIB "oleaut32.dll" ALIAS "VarDecFromI2" ( BYVAL uiIn AS INTEGER
 , BYREF pdecOut AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecFromI4 LIB "oleaut32.dll" ALIAS "VarDecFromI4" ( BYVAL lIn AS LONG
 , BYREF pdecOut AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecFromI8 LIB "oleaut32.dll" ALIAS "VarDecFromI8" ( BYVAL i64In AS QUAD
 , BYREF pdecOut AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecFromR4 LIB "oleaut32.dll" ALIAS "VarDecFromR4" ( BYVAL fltIn AS SINGLE
 , BYREF pdecOut AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecFromR8 LIB "oleaut32.dll" ALIAS "VarDecFromR8" ( BYVAL dblIn AS DOUBLE
 , BYREF pdecOut AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecFromDate LIB "oleaut32.dll" ALIAS "VarDecFromDate" ( BYVAL dateIn AS DOUBLE
 , BYREF pdecOut AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecFromCy LIB "oleaut32.dll" ALIAS "VarDecFromCy" ( BYVAL cyIn AS CUR
 , BYREF pdecOut AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecFromStr LIB "oleaut32.dll" ALIAS "VarDecFromStr" ( BYREF strIn AS WSTRINGZ
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pdecOut AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecFromDisp LIB "oleaut32.dll" ALIAS "VarDecFromDisp" ( BYVAL pdispIn AS IDispatch
 , BYVAL lcid AS DWORD
 , BYREF pdecOut AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecFromBool LIB "oleaut32.dll" ALIAS "VarDecFromBool" ( BYVAL boolIn AS INTEGER
 , BYREF pdecOut AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecFromI1 LIB "oleaut32.dll" ALIAS "VarDecFromI1" ( BYVAL cIn AS BYTE
 , BYREF pdecOut AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecFromUI2 LIB "oleaut32.dll" ALIAS "VarDecFromUI2" ( BYVAL uiIn AS WORD
 , BYREF pdecOut AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecFromUI4 LIB "oleaut32.dll" ALIAS "VarDecFromUI4" ( BYVAL ulIn AS DWORD
 , BYREF pdecOut AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecFromUI8 LIB "oleaut32.dll" ALIAS "VarDecFromUI8" ( BYVAL ui64In AS QUAD
 , BYREF pdecOut AS ANY
 ) AS LONG
'#define VarUI4FromUI4(in, pOut) (*(pOut) = (in))
'#define VarI4FromI4(in, pOut) (*(pOut) = (in))
DECLARE FUNCTION VarI4FromI8 LIB "oleaut32.dll" ALIAS "VarI4FromI8" ( BYVAL i64In AS QUAD , BYREF plOut AS LONG ) AS LONG
DECLARE FUNCTION VarI4FromUI8 LIB "oleaut32.dll" ALIAS "VarI4FromUI8" ( BYVAL i64In AS QUAD
 , BYREF plOut AS LONG
 ) AS LONG
'#define VarUI8FromUI8(in, pOut) (*(pOut) = (in))
'#define VarI8FromI8(in, pOut) (*(pOut) = (in))
'#define VarUI1FromInt VarUI1FromI4
'#define VarUI1FromUint VarUI1FromUI4
'#define VarI2FromInt VarI2FromI4
'#define VarI2FromUint VarI2FromUI4
'#define VarI4FromInt VarI4FromI4
'#define VarI4FromUint VarI4FromUI4
'#define VarI8FromInt VarI8FromI4
'#define VarI8FromUint VarI8FromUI4
'#define VarR4FromInt VarR4FromI4
'#define VarR4FromUint VarR4FromUI4
'#define VarR8FromInt VarR8FromI4
'#define VarR8FromUint VarR8FromUI4
'#define VarDateFromInt VarDateFromI4
'#define VarDateFromUint VarDateFromUI4
'#define VarCyFromInt VarCyFromI4
'#define VarCyFromUint VarCyFromUI4
'#define VarBstrFromInt VarBstrFromI4
'#define VarBstrFromUint VarBstrFromUI4
'#define VarBoolFromInt VarBoolFromI4
'#define VarBoolFromUint VarBoolFromUI4
'#define VarI1FromInt VarI1FromI4
'#define VarI1FromUint VarI1FromUI4
'#define VarUI2FromInt VarUI2FromI4
'#define VarUI2FromUint VarUI2FromUI4
'#define VarUI4FromInt VarUI4FromI4
'#define VarUI4FromUint VarUI4FromUI4
'#define VarDecFromInt VarDecFromI4
'#define VarDecFromUint VarDecFromUI4
'#define VarIntFromUI1 VarI4FromUI1
'#define VarIntFromI2 VarI4FromI2
'#define VarIntFromI4 VarI4FromI4
'#define VarIntFromI8 VarI4FromI8
'#define VarIntFromR4 VarI4FromR4
'#define VarIntFromR8 VarI4FromR8
'#define VarIntFromDate VarI4FromDate
'#define VarIntFromCy VarI4FromCy
'#define VarIntFromStr VarI4FromStr
'#define VarIntFromDisp VarI4FromDisp
'#define VarIntFromBool VarI4FromBool
'#define VarIntFromI1 VarI4FromI1
'#define VarIntFromUI2 VarI4FromUI2
'#define VarIntFromUI4 VarI4FromUI4
'#define VarIntFromUI8 VarI4FromUI8
'#define VarIntFromDec VarI4FromDec
'#define VarIntFromUint VarI4FromUI4
'#define VarUintFromUI1 VarUI4FromUI1
'#define VarUintFromI2 VarUI4FromI2
'#define VarUintFromI4 VarUI4FromI4
'#define VarUintFromI8 VarUI4FromI8
'#define VarUintFromR4 VarUI4FromR4
'#define VarUintFromR8 VarUI4FromR8
'#define VarUintFromDate VarUI4FromDate
'#define VarUintFromCy VarUI4FromCy
'#define VarUintFromStr VarUI4FromStr
'#define VarUintFromDisp VarUI4FromDisp
'#define VarUintFromBool VarUI4FromBool
'#define VarUintFromI1 VarUI4FromI1
'#define VarUintFromUI2 VarUI4FromUI2
'#define VarUintFromUI4 VarUI4FromUI4
'#define VarUintFromUI8 VarUI4FromUI8
'#define VarUintFromDec VarUI4FromDec
'#define VarUintFromInt VarUI4FromI4
'/* Mac Note: On the Mac, the coersion functions support the
' * Symantec C++ calling convention for float/double. To support
' * float/double arguments compiled with the MPW C compiler,
' * use the following APIs to move MPW float/double values into
' * a VARIANT.
' */
'/*---------------------------------------------------------------------*/
'/* New VARIANT <-> string parsing functions */
'/*---------------------------------------------------------------------*/
' // Size = 24 bytes
TYPE NUMPARSE DWORD
 cDig AS LONG ' INT
 dwInFlags AS DWORD ' ULONG
 dwOutFlags AS DWORD ' ULONG
 cchUsed AS LONG ' INT
 nBaseShift AS LONG ' INT
 nPwr10 AS LONG ' INT
END TYPE
'/* flags used by both dwInFlags and dwOutFlags:
' */
%EQUATE `NUMPRS_LEADING_WHITE = &H0001
%EQUATE `NUMPRS_TRAILING_WHITE = &H0002
%EQUATE `NUMPRS_LEADING_PLUS = &H0004
%EQUATE `NUMPRS_TRAILING_PLUS = &H0008
%EQUATE `NUMPRS_LEADING_MINUS = &H0010
%EQUATE `NUMPRS_TRAILING_MINUS = &H0020
%EQUATE `NUMPRS_HEX_OCT = &H0040
%EQUATE `NUMPRS_PARENS = &H0080
%EQUATE `NUMPRS_DECIMAL = &H0100
%EQUATE `NUMPRS_THOUSANDS = &H0200
%EQUATE `NUMPRS_CURRENCY = &H0400
%EQUATE `NUMPRS_EXPONENT = &H0800
%EQUATE `NUMPRS_USE_ALL = &H1000
%EQUATE `NUMPRS_STD = &H1FFF
'/* flags used by dwOutFlags only:
' */
%EQUATE `NUMPRS_NEG = &H10000
%EQUATE `NUMPRS_INEXACT = &H20000
'/* flags used by VarNumFromParseNum to indicate acceptable result types:
' */
%EQUATE `VTBIT_I1 = &H10000 ' (1 << VT_I1)
%EQUATE `VTBIT_UI1 = &H20000 ' (1 << VT_UI1)
%EQUATE `VTBIT_I2 = &H4 ' (1 << VT_I2)
%EQUATE `VTBIT_UI2 = &H40000 ' (1 << VT_UI2)
%EQUATE `VTBIT_I4 = &H8 ' (1 << VT_I4)
%EQUATE `VTBIT_UI4 = &H80000 ' (1 << VT_UI4)
%EQUATE `VTBIT_I8 = &H100000 ' (1 << VT_I8)
%EQUATE `VTBIT_UI8 = &H200000 ' (1 << VT_UI8)
%EQUATE `VTBIT_R4 = &H10 ' (1 << VT_R4)
%EQUATE `VTBIT_R8 = &H20 ' (1 << VT_R8)
%EQUATE `VTBIT_CY = &H40 ' (1 << VT_CY)
%EQUATE `VTBIT_DECIMAL = &H4000 ' (1 << VT_DECIMAL)
DECLARE FUNCTION VarParseNumFromStr LIB "oleaut32.dll" ALIAS "VarParseNumFromStr" ( BYREF strIn AS WSTRINGZ , BYVAL lcid AS QUAD , BYVAL dwFlags AS QUAD , BYREF pnumprs AS NUMPARSE , BYREF rgbDig AS BYTE ) AS LONG
DECLARE FUNCTION VarNumFromParseNum LIB "oleaut32.dll" ALIAS "VarNumFromParseNum" ( BYREF pnumprs AS NUMPARSE
 , BYREF rgbDig AS BYTE
 , BYVAL dwVtBits AS DWORD
 , BYREF pvar AS ANY
 ) AS LONG
'/*---------------------------------------------------------------------*/
'/* VARTYPE Math API */
'/*---------------------------------------------------------------------*/
DECLARE FUNCTION VarAdd LIB "oleaut32.dll" ALIAS "VarAdd" ( BYREF pvarLeft AS ANY , BYREF pvarRight AS ANY , BYREF pvarResult AS ANY ) AS LONG
DECLARE FUNCTION VarAnd LIB "oleaut32.dll" ALIAS "VarAnd" ( BYREF pvarLeft AS ANY
 , BYREF pvarRight AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarCat LIB "oleaut32.dll" ALIAS "VarCat" ( BYREF pvarLeft AS ANY
 , BYREF pvarRight AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarDiv LIB "oleaut32.dll" ALIAS "VarDiv" ( BYREF pvarLeft AS ANY
 , BYREF pvarRight AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarEqv LIB "oleaut32.dll" ALIAS "VarEqv" ( BYREF pvarLeft AS ANY
 , BYREF pvarRight AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarIdiv LIB "oleaut32.dll" ALIAS "VarIdiv" ( BYREF pvarLeft AS ANY
 , BYREF pvarRight AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarImp LIB "oleaut32.dll" ALIAS "VarImp" ( BYREF pvarLeft AS ANY
 , BYREF pvarRight AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarMod LIB "oleaut32.dll" ALIAS "VarMod" ( BYREF pvarLeft AS ANY
 , BYREF pvarRight AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarMul LIB "oleaut32.dll" ALIAS "VarMul" ( BYREF pvarLeft AS ANY
 , BYREF pvarRight AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarOr LIB "oleaut32.dll" ALIAS "VarOr" ( BYREF pvarLeft AS ANY
 , BYREF pvarRight AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarPow LIB "oleaut32.dll" ALIAS "VarPow" ( BYREF pvarLeft AS ANY
 , BYREF pvarRight AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarSub LIB "oleaut32.dll" ALIAS "VarSub" ( BYREF pvarLeft AS ANY
 , BYREF pvarRight AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarXor LIB "oleaut32.dll" ALIAS "VarXor" ( BYREF pvarLeft AS ANY
 , BYREF pvarRight AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarAbs LIB "oleaut32.dll" ALIAS "VarAbs" ( BYREF pvarIn AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarFix LIB "oleaut32.dll" ALIAS "VarFix" ( BYREF pvarIn AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarInt LIB "oleaut32.dll" ALIAS "VarInt" ( BYREF pvarIn AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarNeg LIB "oleaut32.dll" ALIAS "VarNeg" ( BYREF pvarIn AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarNot LIB "oleaut32.dll" ALIAS "VarNot" ( BYREF pvarIn AS ANY
 , BYREF pvarResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarRound LIB "oleaut32.dll" ALIAS "VarRound" ( BYREF pvarIn AS ANY
 , BYVAL cDecimals AS LONG
 , BYREF pvarResult AS ANY
 ) AS LONG
'// dwFlags passed to CompareString if a string compare
DECLARE FUNCTION VarCmp LIB "oleaut32.dll" ALIAS "VarCmp" ( BYREF pvarLeft AS ANY , BYREF pvarRight AS ANY , BYVAL lcid AS QUAD , BYVAL dwFlags AS QUAD ) AS LONG
'#ifdef __cplusplus
'extern "C++" {
'// Add wrapper for old ATL headers to call
'#if !defined(_M_CEE_PURE)
'STDAPICALLTYPE
'#endif
'VarCmp(LPVARIANT pvarLeft, LPVARIANT pvarRight, LCID lcid) {
' return VarCmp(pvarLeft, pvarRight, lcid, 0);
'}
'} // extern "C++"
'#endif
'// Decimal math
'//
DECLARE FUNCTION VarDecAdd LIB "oleaut32.dll" ALIAS "VarDecAdd" ( BYREF pdecLeft AS ANY , BYREF pdecRight AS ANY , BYREF pdecResult AS ANY ) AS LONG
DECLARE FUNCTION VarDecDiv LIB "oleaut32.dll" ALIAS "VarDecDiv" ( BYREF pdecLeft AS ANY
 , BYREF pdecRight AS ANY
 , BYREF pdecResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecMul LIB "oleaut32.dll" ALIAS "VarDecMul" ( BYREF pdecLeft AS ANY
 , BYREF pdecRight AS ANY
 , BYREF pdecResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecSub LIB "oleaut32.dll" ALIAS "VarDecSub" ( BYREF pdecLeft AS ANY
 , BYREF pdecRight AS ANY
 , BYREF pdecResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecAbs LIB "oleaut32.dll" ALIAS "VarDecAbs" ( BYREF pdecIn AS ANY
 , BYREF pdecResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecFix LIB "oleaut32.dll" ALIAS "VarDecFix" ( BYREF pdecIn AS ANY
 , BYREF pdecResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecInt LIB "oleaut32.dll" ALIAS "VarDecInt" ( BYREF pdecIn AS ANY
 , BYREF pdecResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecNeg LIB "oleaut32.dll" ALIAS "VarDecNeg" ( BYREF pdecIn AS ANY
 , BYREF pdecResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecRound LIB "oleaut32.dll" ALIAS "VarDecRound" ( BYREF pdecIn AS ANY
 , BYVAL cDecimals AS LONG
 , BYREF pdecResult AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecCmp LIB "oleaut32.dll" ALIAS "VarDecCmp" ( BYREF pdecLeft AS ANY
 , BYREF pdecRight AS ANY
 ) AS LONG
DECLARE FUNCTION VarDecCmpR8 LIB "oleaut32.dll" ALIAS "VarDecCmpR8" ( BYREF pdecIn AS ANY
 , BYVAL dblRight AS DOUBLE
 ) AS LONG
'// Currency math
'//
DECLARE FUNCTION VarCyAdd LIB "oleaut32.dll" ALIAS "VarCyAdd" ( BYVAL cyLeft AS CUR , BYVAL cyRight AS CUR , BYREF pcyResult AS CUR ) AS LONG
DECLARE FUNCTION VarCyMul LIB "oleaut32.dll" ALIAS "VarCyMul" ( BYVAL cyLeft AS CUR
 , BYVAL cyRight AS CUR
 , BYREF pcyResult AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyMulI4 LIB "oleaut32.dll" ALIAS "VarCyMulI4" ( BYVAL cyLeft AS CUR
 , BYVAL lRight AS LONG
 , BYREF pcyResult AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyMulI8 LIB "oleaut32.dll" ALIAS "VarCyMulI8" ( BYVAL cyLeft AS CUR
 , BYVAL lRight AS QUAD
 , BYREF pcyResult AS CUR
 ) AS LONG
DECLARE FUNCTION VarCySub LIB "oleaut32.dll" ALIAS "VarCySub" ( BYVAL cyLeft AS CUR
 , BYVAL cyRight AS CUR
 , BYREF pcyResult AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyAbs LIB "oleaut32.dll" ALIAS "VarCyAbs" ( BYVAL cyIn AS CUR
 , BYREF pcyResult AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyFix LIB "oleaut32.dll" ALIAS "VarCyFix" ( BYVAL cyIn AS CUR
 , BYREF pcyResult AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyInt LIB "oleaut32.dll" ALIAS "VarCyInt" ( BYVAL cyIn AS CUR
 , BYREF pcyResult AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyNeg LIB "oleaut32.dll" ALIAS "VarCyNeg" ( BYVAL cyIn AS CUR
 , BYREF pcyResult AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyRound LIB "oleaut32.dll" ALIAS "VarCyRound" ( BYVAL cyIn AS CUR
 , BYVAL cDecimals AS LONG
 , BYREF pcyResult AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyCmp LIB "oleaut32.dll" ALIAS "VarCyCmp" ( BYVAL cyLeft AS CUR
 , BYREF cyRight AS CUR
 ) AS LONG
DECLARE FUNCTION VarCyCmpR8 LIB "oleaut32.dll" ALIAS "VarCyCmpR8" ( BYVAL cyLeft AS CUR
 , BYVAL dblRight AS DOUBLE
 ) AS LONG
'// Misc support functions
'//
DECLARE FUNCTION VarBstrCat LIB "oleaut32.dll" ALIAS "VarBstrCat" ( BYREF bstrLeft AS WSTRING , BYREF bstrRight AS WSTRING , BYREF pbstrResult AS WSTRING ) AS LONG
DECLARE FUNCTION VarBstrCmp LIB "oleaut32.dll" ALIAS "VarBstrCmp" ( BYREF bstr AS WSTRING
 , BYREF bstrRight AS WSTRING
 , BYVAL lcid AS DWORD
 , BYVAL dwFLags AS DWORD
 ) AS LONG
DECLARE FUNCTION VarR8Pow LIB "oleaut32.dll" ALIAS "VarR8Pow" ( BYVAL dblLeft AS DOUBLE
 , BYVAL dblRight AS DOUBLE
 , BYREF pdblResult AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarR4CmpR8 LIB "oleaut32.dll" ALIAS "VarR4CmpR8" ( BYVAL fltLeft AS SINGLE
 , BYVAL dblRight AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarR8Round LIB "oleaut32.dll" ALIAS "VarR8Round" ( BYVAL dblIn AS DOUBLE
 , BYVAL cDecimals AS LONG
 , BYREF pdblResult AS DOUBLE
 ) AS LONG
'// Compare results. These are returned as a SUCCESS HResult. Subtracting
'// one gives the usual values of -1 for Less Than, 0 for Equal To, +1 for
'// Greater Than.
'//
%EQUATE `VARCMP_LT = 0
%EQUATE `VARCMP_EQ = 1
%EQUATE `VARCMP_GT = 2
%EQUATE `VARCMP_NULL = 3
'// VT_HARDTYPE tells the compare routine that the argument is a literal or
'// otherwise declared of that specific type. It causes comparison rules to
'// change. For example, if a hard-type string is compared to a variant (not hard
'// -type) number, the number is converted to string. If a hard-type number is
'// compared to a variant string, the string is converted to number. If they're
'// both variant, then number < string.
%EQUATE `VT_HARDTYPE = %VT_RESERVED
'/*---------------------------------------------------------------------*/
'/* New date functions */
'/*---------------------------------------------------------------------*/
'/* The UDATE structure is used with VarDateFromUdate() and VarUdateFromDate().
' * It represents an "unpacked date".
' */
' // Size = 18 bytes
TYPE UDATE WORD
 st AS SYSTEMTIME ' SYSTEMTIME
 wDayOfYear AS WORD ' USHORT
END TYPE
'/* APIs to "pack" and "unpack" dates.
' * NOTE: Ex version of VarDateFromUdate obeys 2 digit year setting in
' * control panel.
' */
DECLARE FUNCTION VarDateFromUdate LIB "oleaut32.dll" ALIAS "VarDateFromUdate" ( BYREF pudateIn AS UDATE , BYVAL dwFlags AS QUAD , BYREF pdateOut AS DOUBLE ) AS LONG
DECLARE FUNCTION VarDateFromUdateEx LIB "oleaut32.dll" ALIAS "VarDateFromUdateEx" ( BYREF pudateIn AS UDATE
 , BYVAL lcid AS DWORD
 , BYVAL dwFlags AS DWORD
 , BYREF pdateOut AS DOUBLE
 ) AS LONG
DECLARE FUNCTION VarUdateFromDate LIB "oleaut32.dll" ALIAS "VarUdateFromDate" ( BYVAL dateIns AS DOUBLE
 , BYVAL dwFlags AS DWORD
 , BYREF pudateOut AS UDATE
 ) AS LONG
'/* API to retrieve the secondary(altername) month names
' Useful for Hijri, Polish and Russian alternate month names
'*/
DECLARE FUNCTION GetAltMonthNames LIB "oleaut32.dll" ALIAS "GetAltMonthNames" ( BYVAL lcid AS QUAD , BYREF prgp AS QUAD ) AS LONG
'/*---------------------------------------------------------------------*/
'/* Format */
'/*---------------------------------------------------------------------*/
DECLARE FUNCTION VarFormat LIB "oleaut32.dll" ALIAS "VarFormat" ( BYREF pvarIn AS ANY , BYREF pbstrFormat AS WSTRINGZ , BYVAL iFirstDay AS LONG , BYVAL iFirstWeek AS LONG , BYVAL dwFlags AS QUAD , BYREF pbstrOut AS WSTRING ) AS LONG
DECLARE FUNCTION VarFormatDateTime LIB "oleaut32.dll" ALIAS "VarFormatDateTime" ( BYREF pvarIn AS ANY
 , BYVAL iNamedFormat AS LONG
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarFormatNumber LIB "oleaut32.dll" ALIAS "VarFormatNumber" ( BYREF pvarIn AS ANY
 , BYVAL iNumDig AS LONG
 , BYVAL ilncLead AS LONG
 , BYVAL iUseParens AS LONG
 , BYVAL iGroup AS LONG
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarFormatPercent LIB "oleaut32.dll" ALIAS "VarFormatPercent" ( BYREF pvarIn AS ANY
 , BYVAL iNumDig AS LONG
 , BYVAL ilncLead AS LONG
 , BYVAL iUseParens AS LONG
 , BYVAL iGroup AS LONG
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarFormatCurrency LIB "oleaut32.dll" ALIAS "VarFormatCurrency" ( BYREF pvarIn AS ANY
 , BYVAL iNumDig AS LONG
 , BYVAL ilncLead AS LONG
 , BYVAL iUseParens AS LONG
 , BYVAL iGroup AS LONG
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarWeekdayName LIB "oleaut32.dll" ALIAS "VarWeekdayName" ( BYVAL iWeekday AS LONG
 , BYVAL fAbbrey AS LONG
 , BYVAL iFirstDay AS LONG
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarMonthName LIB "oleaut32.dll" ALIAS "VarMonthName" ( BYVAL iMonth AS LONG
 , BYVAL fAbbrey AS LONG
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 ) AS LONG
DECLARE FUNCTION VarFormatFromTokens LIB "oleaut32.dll" ALIAS "VarFormatFromTokens" ( BYREF pvarIn AS ANY
 , BYREF pstrFormat AS WSTRINGZ
 , BYVAL pbTokCur AS BYTE PTR
 , BYVAL dwFlags AS DWORD
 , BYREF pbstrOut AS WSTRING
 , BYVAL lcid AS DWORD
 ) AS LONG
DECLARE FUNCTION VarTokenizeFormatString LIB "oleaut32.dll" ALIAS "VarTokenizeFormatString" ( BYREF pstrFormat AS WSTRINGZ
 , BYVAL rgbTok AS BYTE PTR
 , BYVAL cbTok AS LONG
 , BYVAL iFirstDay AS LONG
 , BYVAL iFirstWeek AS LONG
 , BYVAL lcid AS DWORD
 , BYREF pcbActual AS LONG
 ) AS LONG
'/*---------------------------------------------------------------------*/
'/* ITypeLib */
'/*---------------------------------------------------------------------*/
'typedef /* [unique] */ __RPC_unique_pointer ITypeLib *LPTYPELIB;
'/*---------------------------------------------------------------------*/
'/* ITypeInfo */
'/*---------------------------------------------------------------------*/
'typedef LONG DISPID;
'typedef DISPID MEMBERID;
%EQUATE `MEMBERID_NIL = %DISPID_UNKNOWN
%EQUATE `ID_DEFAULTINST = -2
'/* Flags for IDispatch::Invoke */
%EQUATE `DISPATCH_METHOD = &H1
%EQUATE `DISPATCH_PROPERTYGET = &H2
%EQUATE `DISPATCH_PROPERTYPUT = &H4
%EQUATE `DISPATCH_PROPERTYPUTREF = &H8
' Note: For VBer's that are used to vbxxx constants.
%EQUATE `vbMethod = 1 ' &H1
%EQUATE `vbCall = 1 ' &H1
%EQUATE `vbGet = 2 ' &H2
%EQUATE `vbLet = 4 ' &H4
%EQUATE `vbPut = 4 ' &H4
%EQUATE `vbSet = 8 ' &H8
%EQUATE `vbPutRef = 8 ' &H8
'typedef /* [unique] */ __RPC_unique_pointer ITypeInfo *LPTYPEINFO;
'/*---------------------------------------------------------------------*/
'/* ITypeComp */
'/*---------------------------------------------------------------------*/
'typedef /* [unique] */ __RPC_unique_pointer ITypeComp *LPTYPECOMP;
'/*---------------------------------------------------------------------*/
'/* ICreateTypeLib */
'/*---------------------------------------------------------------------*/
'typedef ICreateTypeLib * LPCREATETYPELIB;
'typedef ICreateTypeInfo * LPCREATETYPEINFO;
'/*---------------------------------------------------------------------*/
'/* TypeInfo API */
'/*---------------------------------------------------------------------*/
'/* compute a 16bit hash value for the given name
' */
'#if (defined (_WIN32) || defined (_WIN64))
DECLARE FUNCTION LHashValOfNameSysA LIB "oleaut32.dll" ALIAS "LHashValOfNameSysA" ( BYVAL syskind AS LONG , BYVAL lcid AS QUAD , BYREF szName AS ASCIIZ ) AS QUAD ' ULONG
'#endif
DECLARE FUNCTION LHashValOfNameSys LIB "oleaut32.dll" ALIAS "LHashValOfNameSys" ( BYVAL syskind AS LONG , BYVAL lcid AS QUAD , BYREF szName AS WSTRINGZ ) AS QUAD ' ULONG
'#define LHashValOfName(lcid, szName) \
' LHashValOfNameSys(SYS_WIN32, lcid, szName)
FUNCTION LHashValOfName (BYVAL lcid AS DWORD, BYREF szName AS WSTRINGZ) AS DWORD
 FUNCTION = LHashValOfNameSys(%SYS_WIN32, lcid, szName)
END FUNCTION
'#define WHashValOfLHashVal(lhashval) \
' ((USHORT) (0x0000ffff & (lhashval)))
FUNCTION WHashValOfLHashVal (BYVAL lhashval AS DWORD) AS DWORD
 FUNCTION = (&H0000ffff AND lhashval)
END FUNCTION
'#define IsHashValCompatible(lhashval1, lhashval2) \
' ((BOOL) ((0x00ff0000 & (lhashval1)) == (0x00ff0000 & (lhashval2))))
FUNCTION IsHashValCompatible (BYVAL lhashval1 AS DWORD, BYVAL lhashval2 AS DWORD) AS LONG
 FUNCTION = ((&H00ff0000 AND lhashval1) = (&H00ff0000 AND lhashval2))
END FUNCTION
'/* load the typelib from the file with the given filename
' */
DECLARE FUNCTION LoadTypeLib LIB "oleaut32.dll" ALIAS "LoadTypeLib" ( BYREF szFile AS WSTRINGZ , BYREF pptlib AS ITypeLib ) AS LONG
'/* Control how a type library is registered
' */
' REGKIND enum
%EQUATE `REGKIND_DEFAULT = 0 ' Use default register behavior.
%EQUATE `REGKIND_REGISTER = 1 ' Register this type library.
%EQUATE `REGKIND_NONE = 2 ' Do not register this type library.
'// Constants for specifying format in which TLB should be loaded
'// (the default format is 32-bit on WIN32 and 64-bit on WIN64)
%EQUATE `LOAD_TLB_AS_32BIT = &H20
%EQUATE `LOAD_TLB_AS_64BIT = &H40
%EQUATE `MASK_TO_RESET_TLB_BITS = NOT (%LOAD_TLB_AS_32BIT OR %LOAD_TLB_AS_64BIT)
DECLARE FUNCTION LoadTypeLibEx LIB "oleaut32.dll" ALIAS "LoadTypeLibEx" ( BYREF szFile AS WSTRINGZ , BYVAL regkind AS LONG , BYREF pptlib AS ITypeLib ) AS LONG
'/* load registered typelib
' */
DECLARE FUNCTION LoadRegTypeLib LIB "oleaut32.dll" ALIAS "LoadRegTypeLib" ( BYREF rguid AS GUID , BYVAL wVerMajor AS WORD , BYVAL wVerMinor AS WORD , BYVAL lcid AS QUAD , BYREF pptlib AS ITypeLib ) AS LONG
'/* get path to registered typelib
' */
DECLARE FUNCTION QueryPathOfRegTypeLib LIB "oleaut32.dll" ALIAS "QueryPathOfRegTypeLib" ( BYREF guid AS GUID , BYVAL wVerMajor AS WORD , BYVAL wVerMinor AS WORD , BYVAL lcid AS QUAD , BYREF lpbstrPathName AS WSTRING ) AS LONG
'/* add typelib to registry
' */
DECLARE FUNCTION RegisterTypeLib LIB "oleaut32.dll" ALIAS "RegisterTypeLib" ( BYVAL ptlib AS ITypeLib , BYREF szFullPath AS WSTRINGZ , BYREF szHelpDir AS WSTRINGZ ) AS LONG
'/* remove typelib from registry
' */
DECLARE FUNCTION UnRegisterTypeLib LIB "oleaut32.dll" ALIAS "UnRegisterTypeLib" ( BYREF libID AS GUID , BYVAL wVerMajor AS WORD , BYVAL wVerMinor AS WORD , BYVAL lcid AS LONG , BYVAL syskind AS LONG ) AS LONG
'/* Registers a type library for use by the calling user.
'*/
DECLARE FUNCTION RegisterTypeLibForUser LIB "oleaut32.dll" ALIAS "RegisterTypeLibForUser" ( BYREF libID AS GUID , BYVAL wVerMajor AS WORD , BYVAL wVerMinor AS WORD , BYVAL lcid AS LONG , BYVAL syskind AS LONG ) AS LONG
'/* Removes type library information that was registered by using RegisterTypeLibForUser.
'*/
DECLARE FUNCTION UnRegisterTypeLibForUser LIB "oleaut32.dll" ALIAS "UnRegisterTypeLibForUser" ( BYREF libID AS GUID , BYVAL wVerMajor AS WORD , BYVAL wVerMinor AS WORD , BYVAL lcid AS LONG , BYVAL syskind AS LONG ) AS LONG
DECLARE FUNCTION CreateTypeLib LIB "oleaut32.dll" ALIAS "CreateTypeLib" ( BYVAL syskind AS LONG
 , BYREF szFile AS WSTRINGZ
 , BYREF ppctlib AS ICreateTypeLib
 ) AS LONG
DECLARE FUNCTION CreateTypeLib2 LIB "oleaut32.dll" ALIAS "CreateTypeLib2" ( BYVAL syskind AS LONG
 , BYREF szFile AS WSTRINGZ
 , BYREF ppctlib AS ICreateTypeLib2
 ) AS LONG
'/*---------------------------------------------------------------------*/
'/* IDispatch implementation support */
'/*---------------------------------------------------------------------*/
'typedef /* [unique] */ __RPC_unique_pointer IDispatch *LPDISPATCH;
' // Size = 8 bytes
TYPE PARAMDATA DWORD
 szName AS WSTRINGZ PTR ' OLECHAR * szName; /* parameter name */
 vt AS WORD ' VARTYPE vt; /* parameter type */
END TYPE
' // Size = 28 bytes
TYPE METHODDATA WORD
 szName AS WSTRINGZ PTR ' OLECHAR * szName; /* method name */
 ppdata AS PARAMDATA PTR ' PARAMDATA * ppdata; /* pointer to an array of PARAMDATAs */
 dispid AS LONG ' DISPID dispid; /* method ID */
 iMeth AS DWORD ' UINT iMeth; /* method index */
 cc AS DWORD ' CALLCONV cc; /* calling convention */
 cArgs AS DWORD ' UINT cArgs; /* count of arguments */
 wFlags AS WORD ' WORD wFlags; /* same wFlags as on IDispatch::Invoke() */
 vtReturn AS WORD ' VARTYPE vtReturn;
END TYPE
' // Size = 8 bytes
TYPE INTERFACEDATA DWORD
 pmethdata AS METHODDATA PTR ' METHODDATA * pmethdata; /* pointer to an array of METHODDATAs */
 cMembers AS LONG ' UINT cMembers; /* count of members */
END TYPE
'/* Locate the parameter indicated by the given position, and
' * return it coerced to the given target VARTYPE (vtTarg).
' */
DECLARE FUNCTION DispGetParam LIB "oleaut32.dll" ALIAS "DispGetParam" ( BYREF pdispparams AS DISPPARAMS , BYVAL position AS QUAD , BYVAL vtTarg AS WORD , BYREF pvarResult AS ANY , BYREF puArgErr AS QUAD ) AS LONG
'/* Automatic TypeInfo driven implementation of IDispatch::GetIDsOfNames()
' */
DECLARE FUNCTION DispGetIDsOfNames LIB "oleaut32.dll" ALIAS "DispGetIDsOfNames" ( BYVAL ptinfo AS ITypeInfo , BYREF rgszNames AS ANY , BYVAL cNames AS QUAD , BYREF rgdispid AS LONG ) AS LONG
'/* Automatic TypeInfo driven implementation of IDispatch::Invoke()
' */
DECLARE FUNCTION DispInvoke LIB "oleaut32.dll" ALIAS "DispInvoke" ( BYVAL this AS IDispatch , BYVAL ptinfo AS ITypeInfo , BYVAL dispidMember AS LONG , BYVAL wFlags AS WORD , BYREF pparams AS DISPPARAMS , BYREF pvarResult AS ANY , BYREF pexcepinfo AS EXCEPINFO , BYREF puArgErr AS QUAD ) AS LONG
'/* Construct a TypeInfo from an interface data description
' */
DECLARE FUNCTION CreateDispTypeInfo LIB "oleaut32.dll" ALIAS "CreateDispTypeInfo" ( BYREF pidata AS INTERFACEDATA , BYVAL lcid AS QUAD , BYREF pptinfo AS ITypeInfo ) AS LONG
'/* Create an instance of the standard TypeInfo driven IDispatch
' * implementation.
' */
DECLARE FUNCTION CreateStdDispatch LIB "oleaut32.dll" ALIAS "CreateStdDispatch" ( BYVAL punkOuter AS IUnknown , BYVAL pvThis AS IDispatch , BYVAL ptinfo AS ITypeInfo , BYREF ppunkStdDisp AS IUnknown ) AS LONG
'/* Low-level helper for IDispatch::Invoke() provides machine independence
' * for customized Invoke().
' */
DECLARE FUNCTION DispCallFunc LIB "oleaut32.dll" ALIAS "DispCallFunc" ( BYVAL pvInstance AS IDispatch , BYVAL oVft AS QUAD , BYVAL cc AS QUAD , BYVAL vtReturn AS WORD , BYVAL cActuals AS QUAD , BYREF prgvt AS WORD , BYREF prgpvarg AS ANY , BYREF pvargResult AS ANY ) AS LONG
'/*---------------------------------------------------------------------*/
'/* Active Object Registration API */
'/*---------------------------------------------------------------------*/
'/* flags for RegisterActiveObject */
%EQUATE `ACTIVEOBJECT_STRONG = &H0
%EQUATE `ACTIVEOBJECT_WEAK = &H1
DECLARE FUNCTION RegisterActiveObject LIB "oleaut32.dll" ALIAS "RegisterActiveObject" ( BYVAL punk AS IUnknown , BYREF rclsid AS GUID , BYVAL dwFlags AS QUAD , BYREF pdwRegister AS QUAD ) AS LONG
DECLARE FUNCTION RevokeactiveObject LIB "oleaut32.dll" ALIAS "RevokeactiveObject" ( BYVAL dwRegister AS QUAD
 , BYVAL pvReserved AS DWORD
 ) AS LONG
DECLARE FUNCTION GetActiveObject LIB "oleaut32.dll" ALIAS "GetActiveObject" ( BYREF rclsid AS GUID
 , BYVAL pvReserved AS DWORD
 , BYREF ppunk AS IUnknown
 ) AS LONG
'/*---------------------------------------------------------------------*/
'/* ErrorInfo API */
'/*---------------------------------------------------------------------*/
DECLARE FUNCTION SetErrorInfo LIB "oleaut32.dll" ALIAS "SetErrorInfo" ( BYVAL dwReserved AS QUAD , BYVAL perrinfo AS IErrorInfo ) AS LONG
DECLARE FUNCTION GetErrorInfo LIB "oleaut32.dll" ALIAS "GetErrorInfo" ( BYVAL dwReserved AS QUAD
 , BYREF IErrorInfo
 ) AS LONG
DECLARE FUNCTION CreateErrorInfo LIB "oleaut32.dll" ALIAS "CreateErrorInfo" ( BYREF pperrinfo AS ICreateErrorInfo
 ) AS LONG
' ========================================================================================
' The ERRORINFO structure returns most of the basic information associated with an error.
' ========================================================================================
' // Size = 44 bytes
TYPE ERRORINFO DWORD
 hrError AS DWORD ' // The code returned by the method.
 dwMinor AS DWORD ' // A provider-specific error code.
 clsid AS GUID ' // The class ID of the object that returned the error.
 iid AS GUID ' // The interface ID of the interface that generated the error.
 dispid AS LONG ' // Optional and provider-specific. Could be used, for example, to indicate the method that returned the error.
END TYPE
'/*---------------------------------------------------------------------*/
'/* User Defined Data types support */
'/*---------------------------------------------------------------------*/
DECLARE FUNCTION GetRecordInfoFromTypeInfo LIB "oleaut32.dll" ALIAS "GetRecordInfoFromTypeInfo" ( BYVAL pTypeInfo AS ITypeInfo , BYREF ppRecInfo AS IRecordInfo ) AS LONG
DECLARE FUNCTION GetRecordInfoFromGuids LIB "oleaut32.dll" ALIAS "GetRecordInfoFromGuids" ( BYREF rGuidTypeLib AS GUID
 , BYVAL uVerMajor AS DWORD
 , BYVAL uVerMinor AS DWORD
 , BYVAL lcid AS DWORD
 , BYREF rGuidTypeInfo AS GUID
 , BYREF ppRecInfo AS IRecordInfo
 ) AS LONG
'/*---------------------------------------------------------------------*/
'/* MISC API */
'/*---------------------------------------------------------------------*/
DECLARE FUNCTION OaBuildVersion LIB "oleaut32.dll" ALIAS "OaBuildVersion" ( ) AS QUAD ' ULONG
DECLARE FUNCTION ClearCustData LIB "oleaut32.dll" ALIAS "ClearCustData" ( BYREF pCustData AS CUSTDATA ) AS QUAD ' ULONG
'#if (NTDDI_VERSION >= NTDDI_VISTASP1)
DECLARE SUB OaEnablePerUserTLibRegistration LIB "oleaut32.dll" ALIAS "OaEnablePerUserTLibRegistration" ()
'#endif
'// Declare variant access functions.
'#if __STDC__ || defined(NONAMELESSUNION)
'#define V_UNION(X, Y) ((X)->n1.n2.n3.Y)
'#define V_VT(X) ((X)->n1.n2.vt)
'#define V_RECORDINFO(X) ((X)->n1.n2.n3.brecVal.pRecInfo)
'#define V_RECORD(X) ((X)->n1.n2.n3.brecVal.pvRecord)
'#else
'#define V_UNION(X, Y) ((X)->Y)
'#define V_VT(X) ((X)->vt)
'#define V_RECORDINFO(X) ((X)->pRecInfo)
'#define V_RECORD(X) ((X)->pvRecord)
'#endif
'/* Variant access macros
' */
'#define V_ISBYREF(X) (V_VT(X)&VT_BYREF)
'#define V_ISARRAY(X) (V_VT(X)&VT_ARRAY)
'#define V_ISVECTOR(X) (V_VT(X)&VT_VECTOR)
'#define V_NONE(X) V_I2(X)
'#define V_UI1(X) V_UNION(X, bVal)
'#define V_UI1REF(X) V_UNION(X, pbVal)
'#define V_I2(X) V_UNION(X, iVal)
'#define V_I2REF(X) V_UNION(X, piVal)
'#define V_I4(X) V_UNION(X, lVal)
'#define V_I4REF(X) V_UNION(X, plVal)
'#define V_I8(X) V_UNION(X, llVal)
'#define V_I8REF(X) V_UNION(X, pllVal)
'#define V_R4(X) V_UNION(X, fltVal)
'#define V_R4REF(X) V_UNION(X, pfltVal)
'#define V_R8(X) V_UNION(X, dblVal)
'#define V_R8REF(X) V_UNION(X, pdblVal)
'#define V_I1(X) V_UNION(X, cVal)
'#define V_I1REF(X) V_UNION(X, pcVal)
'#define V_UI2(X) V_UNION(X, uiVal)
'#define V_UI2REF(X) V_UNION(X, puiVal)
'#define V_UI4(X) V_UNION(X, ulVal)
'#define V_UI4REF(X) V_UNION(X, pulVal)
'#define V_UI8(X) V_UNION(X, ullVal)
'#define V_UI8REF(X) V_UNION(X, pullVal)
'#define V_INT(X) V_UNION(X, intVal)
'#define V_INTREF(X) V_UNION(X, pintVal)
'#define V_UINT(X) V_UNION(X, uintVal)
'#define V_UINTREF(X) V_UNION(X, puintVal)
'#ifdef _WIN64
'#define V_INT_PTR(X) V_UNION(X, llVal)
'#define V_UINT_PTR(X) V_UNION(X, ullVal)
'#define V_INT_PTRREF(X) V_UNION(X, pllVal)
'#define V_UINT_PTRREF(X) V_UNION(X, pullVal)
'#else
'#define V_INT_PTR(X) V_UNION(X, lVal)
'#define V_UINT_PTR(X) V_UNION(X, ulVal)
'#define V_INT_PTRREF(X) V_UNION(X, plVal)
'#define V_UINT_PTRREF(X) V_UNION(X, pulVal)
'#endif
'#define V_CY(X) V_UNION(X, cyVal)
'#define V_CYREF(X) V_UNION(X, pcyVal)
'#define V_DATE(X) V_UNION(X, date)
'#define V_DATEREF(X) V_UNION(X, pdate)
'#define V_BSTR(X) V_UNION(X, bstrVal)
'#define V_BSTRREF(X) V_UNION(X, pbstrVal)
'#define V_DISPATCH(X) V_UNION(X, pdispVal)
'#define V_DISPATCHREF(X) V_UNION(X, ppdispVal)
'#define V_ERROR(X) V_UNION(X, scode)
'#define V_ERRORREF(X) V_UNION(X, pscode)
'#define V_BOOL(X) V_UNION(X, boolVal)
'#define V_BOOLREF(X) V_UNION(X, pboolVal)
'#define V_UNKNOWN(X) V_UNION(X, punkVal)
'#define V_UNKNOWNREF(X) V_UNION(X, ppunkVal)
'#define V_VARIANTREF(X) V_UNION(X, pvarVal)
'#define V_ARRAY(X) V_UNION(X, parray)
'#define V_ARRAYREF(X) V_UNION(X, pparray)
'#define V_BYREF(X) V_UNION(X, byref)
'#define V_DECIMAL(X) V_UNION(X, decVal)
'#define V_DECIMALREF(X) V_UNION(X, pdecVal)
#ENDIF
