home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
OLE2.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-02-28
|
156KB
|
4,130 lines
{*******************************************************}
{ }
{ Delphi Runtime Library }
{ OLE 2 Interface Unit }
{ }
{ Copyright (c) 1996-1997 Borland International }
{ }
{*******************************************************}
unit OLE2; // $Revision: 1.11 $
interface
uses Windows;
{ OLE error definitions and values
The return value of OLE APIs and methods is an HRESULT.
This is not a handle to anything, but is merely a 32-bit value
with several fields encoded in the value. The parts of an
HRESULT are shown below.
Many of the macros and functions below were orginally defined to
operate on SCODEs. SCODEs are no longer used. The macros are
still present for compatibility and easy porting of Win16 code.
Newly written code should use the HRESULT macros and functions.
HRESULTs are 32 bit values layed out as follows:
3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+-+-+-+-+-+---------------------+-------------------------------+
|S|R|C|N|r| Facility | Code |
+-+-+-+-+-+---------------------+-------------------------------+
where
S - Severity - indicates success/fail
0 - Success
1 - Fail (COERROR)
R - reserved portion of the facility code, corresponds to NT's
second severity bit.
C - reserved portion of the facility code, corresponds to NT's
C field.
N - reserved portion of the facility code. Used to indicate a
mapped NT status value.
r - reserved portion of the facility code. Reserved for internal
use. Used to indicate HRESULT values that are not status
values, but are instead message ids for display strings.
Facility - is the facility code
Code - is the facility's status code }
const
{ Severity codes }
SEVERITY_SUCCESS = 0;
SEVERITY_ERROR = 1;
{ Error and status code ranges }
OLE_E_FIRST = $80040000;
OLE_E_LAST = $800400FF;
OLE_S_FIRST = $00040000;
OLE_S_LAST = $000400FF;
DRAGDROP_E_FIRST = $80040100;
DRAGDROP_E_LAST = $8004010F;
DRAGDROP_S_FIRST = $00040100;
DRAGDROP_S_LAST = $0004010F;
CLASSFACTORY_E_FIRST = $80040110;
CLASSFACTORY_E_LAST = $8004011F;
CLASSFACTORY_S_FIRST = $00040110;
CLASSFACTORY_S_LAST = $0004011F;
MARSHAL_E_FIRST = $80040120;
MARSHAL_E_LAST = $8004012F;
MARSHAL_S_FIRST = $00040120;
MARSHAL_S_LAST = $0004012F;
DATA_E_FIRST = $80040130;
DATA_E_LAST = $8004013F;
DATA_S_FIRST = $00040130;
DATA_S_LAST = $0004013F;
VIEW_E_FIRST = $80040140;
VIEW_E_LAST = $8004014F;
VIEW_S_FIRST = $00040140;
VIEW_S_LAST = $0004014F;
REGDB_E_FIRST = $80040150;
REGDB_E_LAST = $8004015F;
REGDB_S_FIRST = $00040150;
REGDB_S_LAST = $0004015F;
CACHE_E_FIRST = $80040170;
CACHE_E_LAST = $8004017F;
CACHE_S_FIRST = $00040170;
CACHE_S_LAST = $0004017F;
OLEOBJ_E_FIRST = $80040180;
OLEOBJ_E_LAST = $8004018F;
OLEOBJ_S_FIRST = $00040180;
OLEOBJ_S_LAST = $0004018F;
CLIENTSITE_E_FIRST = $80040190;
CLIENTSITE_E_LAST = $8004019F;
CLIENTSITE_S_FIRST = $00040190;
CLIENTSITE_S_LAST = $0004019F;
INPLACE_E_FIRST = $800401A0;
INPLACE_E_LAST = $800401AF;
INPLACE_S_FIRST = $000401A0;
INPLACE_S_LAST = $000401AF;
ENUM_E_FIRST = $800401B0;
ENUM_E_LAST = $800401BF;
ENUM_S_FIRST = $000401B0;
ENUM_S_LAST = $000401BF;
CONVERT10_E_FIRST = $800401C0;
CONVERT10_E_LAST = $800401CF;
CONVERT10_S_FIRST = $000401C0;
CONVERT10_S_LAST = $000401CF;
CLIPBRD_E_FIRST = $800401D0;
CLIPBRD_E_LAST = $800401DF;
CLIPBRD_S_FIRST = $000401D0;
CLIPBRD_S_LAST = $000401DF;
MK_E_FIRST = $800401E0;
MK_E_LAST = $800401EF;
MK_S_FIRST = $000401E0;
MK_S_LAST = $000401EF;
CO_E_FIRST = $800401F0;
CO_E_LAST = $800401FF;
CO_S_FIRST = $000401F0;
CO_S_LAST = $000401FF;
{ Success codes }
S_OK = 0;
S_FALSE = 1;
{ Catastrophic failure }
E_UNEXPECTED = $8000FFFF;
{ Not implemented }
E_NOTIMPL = $80004001;
{ Ran out of memory }
E_OUTOFMEMORY = $8007000E;
{ One or more arguments are invalid }
E_INVALIDARG = $80070057;
{ No such interface supported }
E_NOINTERFACE = $80004002;
{ Invalid pointer }
E_POINTER = $80004003;
{ Invalid handle }
E_HANDLE = $80070006;
{ Operation aborted }
E_ABORT = $80004004;
{ Unspecified error }
E_FAIL = $80004005;
{ General access denied error }
E_ACCESSDENIED = $80070005;
{ Thread local storage failure }
CO_E_INIT_TLS = $80004006;
{ Get shared memory allocator failure }
CO_E_INIT_SHARED_ALLOCATOR = $80004007;
{ Get memory allocator failure }
CO_E_INIT_MEMORY_ALLOCATOR = $80004008;
{ Unable to initialize class cache }
CO_E_INIT_CLASS_CACHE = $80004009;
{ Unable to initialize RPC services }
CO_E_INIT_RPC_CHANNEL = $8000400A;
{ Cannot set thread local storage channel control }
CO_E_INIT_TLS_SET_CHANNEL_CONTROL = $8000400B;
{ Could not allocate thread local storage channel control }
CO_E_INIT_TLS_CHANNEL_CONTROL = $8000400C;
{ The user supplied memory allocator is unacceptable }
CO_E_INIT_UNACCEPTED_USER_ALLOCATOR = $8000400D;
{ The OLE service mutex already exists }
CO_E_INIT_SCM_MUTEX_EXISTS = $8000400E;
{ The OLE service file mapping already exists }
CO_E_INIT_SCM_FILE_MAPPING_EXISTS = $8000400F;
{ Unable to map view of file for OLE service }
CO_E_INIT_SCM_MAP_VIEW_OF_FILE = $80004010;
{ Failure attempting to launch OLE service }
CO_E_INIT_SCM_EXEC_FAILURE = $80004011;
{ There was an attempt to call CoInitialize a second time while single
threaded }
CO_E_INIT_ONLY_SINGLE_THREADED = $80004012;
{ Invalid OLEVERB structure }
OLE_E_OLEVERB = $80040000;
{ Invalid advise flags }
OLE_E_ADVF = $80040001;
{ Can't enumerate any more, because the associated data is missing }
OLE_E_ENUM_NOMORE = $80040002;
{ This implementation doesn't take advises }
OLE_E_ADVISENOTSUPPORTED = $80040003;
{ There is no connection for this connection ID }
OLE_E_NOCONNECTION = $80040004;
{ Need to run the object to perform this operation }
OLE_E_NOTRUNNING = $80040005;
{ There is no cache to operate on }
OLE_E_NOCACHE = $80040006;
{ Uninitialized object }
OLE_E_BLANK = $80040007;
{ Linked object's source class has changed }
OLE_E_CLASSDIFF = $80040008;
{ Not able to get the moniker of the object }
OLE_E_CANT_GETMONIKER = $80040009;
{ Not able to bind to the source }
OLE_E_CANT_BINDTOSOURCE = $8004000A;
{ Object is static; operation not allowed }
OLE_E_STATIC = $8004000B;
{ User cancelled out of save dialog }
OLE_E_PROMPTSAVECANCELLED = $8004000C;
{ Invalid rectangle }
OLE_E_INVALIDRECT = $8004000D;
{ compobj.dll is too old for the ole2.dll initialized }
OLE_E_WRONGCOMPOBJ = $8004000E;
{ Invalid window handle }
OLE_E_INVALIDHWND = $8004000F;
{ Object is not in any of the inplace active states }
OLE_E_NOT_INPLACEACTIVE = $80040010;
{ Not able to convert object }
OLE_E_CANTCONVERT = $80040011;
{ Not able to perform the operation because object is not given storage yet }
OLE_E_NOSTORAGE = $80040012;
{ Invalid FORMATETC structure }
DV_E_FORMATETC = $80040064;
{ Invalid DVTARGETDEVICE structure }
DV_E_DVTARGETDEVICE = $80040065;
{ Invalid STDGMEDIUM structure }
DV_E_STGMEDIUM = $80040066;
{ Invalid STATDATA structure }
DV_E_STATDATA = $80040067;
{ Invalid lindex }
DV_E_LINDEX = $80040068;
{ Invalid tymed }
DV_E_TYMED = $80040069;
{ Invalid clipboard format }
DV_E_CLIPFORMAT = $8004006A;
{ Invalid aspect(s) }
DV_E_DVASPECT = $8004006B;
{ tdSize parameter of the DVTARGETDEVICE structure is invalid }
DV_E_DVTARGETDEVICE_SIZE = $8004006C;
{ Object doesn't support IViewObject interface }
DV_E_NOIVIEWOBJECT = $8004006D;
{ Trying to revoke a drop target that has not been registered }
DRAGDROP_E_NOTREGISTERED = $80040100;
{ This window has already been registered as a drop target }
DRAGDROP_E_ALREADYREGISTERED = $80040101;
{ Invalid window handle }
DRAGDROP_E_INVALIDHWND = $80040102;
{ Class does not support aggregation (or class object is remote) }
CLASS_E_NOAGGREGATION = $80040110;
{ ClassFactory cannot supply requested class }
CLASS_E_CLASSNOTAVAILABLE = $80040111;
{ Error drawing view }
VIEW_E_DRAW = $80040140;
{ Could not read key from registry }
REGDB_E_READREGDB = $80040150;
{ Could not write key to registry }
REGDB_E_WRITEREGDB = $80040151;
{ Could not find the key in the registry }
REGDB_E_KEYMISSING = $80040152;
{ Invalid value for registry }
REGDB_E_INVALIDVALUE = $80040153;
{ Class not registered }
REGDB_E_CLASSNOTREG = $80040154;
{ Interface not registered }
REGDB_E_IIDNOTREG = $80040155;
{ Cache not updated }
CACHE_E_NOCACHE_UPDATED = $80040170;
{ No verbs for OLE object }
OLEOBJ_E_NOVERBS = $80040180;
{ Invalid verb for OLE object }
OLEOBJ_E_INVALIDVERB = $80040181;
{ Undo is not available }
INPLACE_E_NOTUNDOABLE = $800401A0;
{ Space for tools is not available }
INPLACE_E_NOTOOLSPACE = $800401A1;
{ OLESTREAM Get method failed }
CONVERT10_E_OLESTREAM_GET = $800401C0;
{ OLESTREAM Put method failed }
CONVERT10_E_OLESTREAM_PUT = $800401C1;
{ Contents of the OLESTREAM not in correct format }
CONVERT10_E_OLESTREAM_FMT = $800401C2;
{ There was an error in a Windows GDI call while converting the bitmap
to a DIB }
CONVERT10_E_OLESTREAM_BITMAP_TO_DIB = $800401C3;
{ Contents of the IStorage not in correct format }
CONVERT10_E_STG_FMT = $800401C4;
{ Contents of IStorage is missing one of the standard streams }
CONVERT10_E_STG_NO_STD_STREAM = $800401C5;
{ There was an error in a Windows GDI call while converting the DIB to
a bitmap }
CONVERT10_E_STG_DIB_TO_BITMAP = $800401C6;
{ OpenClipboard Failed }
CLIPBRD_E_CANT_OPEN = $800401D0;
{ EmptyClipboard Failed }
CLIPBRD_E_CANT_EMPTY = $800401D1;
{ SetClipboard Failed }
CLIPBRD_E_CANT_SET = $800401D2;
{ Data on clipboard is invalid }
CLIPBRD_E_BAD_DATA = $800401D3;
{ CloseClipboard Failed }
CLIPBRD_E_CANT_CLOSE = $800401D4;
{ Moniker needs to be connected manually }
MK_E_CONNECTMANUALLY = $800401E0;
{ Operation exceeded deadline }
MK_E_EXCEEDEDDEADLINE = $800401E1;
{ Moniker needs to be generic }
MK_E_NEEDGENERIC = $800401E2;
{ Operation unavailable }
MK_E_UNAVAILABLE = $800401E3;
{ Invalid syntax }
MK_E_SYNTAX = $800401E4;
{ No object for moniker }
MK_E_NOOBJECT = $800401E5;
{ Bad extension for file }
MK_E_INVALIDEXTENSION = $800401E6;
{ Intermediate operation failed }
MK_E_INTERMEDIATEINTERFACENOTSUPPORTED = $800401E7;
{ Moniker is not bindable }
MK_E_NOTBINDABLE = $800401E8;
{ Moniker is not bound }
MK_E_NOTBOUND = $800401E9;
{ Moniker cannot open file }
MK_E_CANTOPENFILE = $800401EA;
{ User input required for operation to succeed }
MK_E_MUSTBOTHERUSER = $800401EB;
{ Moniker class has no inverse }
MK_E_NOINVERSE = $800401EC;
{ Moniker does not refer to storage }
MK_E_NOSTORAGE = $800401ED;
{ No common prefix }
MK_E_NOPREFIX = $800401EE;
{ Moniker could not be enumerated }
MK_E_ENUMERATION_FAILED = $800401EF;
{ CoInitialize has not been called. }
CO_E_NOTINITIALIZED = $800401F0;
{ CoInitialize has already been called. }
CO_E_ALREADYINITIALIZED = $800401F1;
{ Class of object cannot be determined }
CO_E_CANTDETERMINECLASS = $800401F2;
{ Invalid class string }
CO_E_CLASSSTRING = $800401F3;
{ Invalid interface string }
CO_E_IIDSTRING = $800401F4;
{ Application not found }
CO_E_APPNOTFOUND = $800401F5;
{ Application cannot be run more than once }
CO_E_APPSINGLEUSE = $800401F6;
{ Some error in application program }
CO_E_ERRORINAPP = $800401F7;
{ DLL for class not found }
CO_E_DLLNOTFOUND = $800401F8;
{ Error in the DLL }
CO_E_ERRORINDLL = $800401F9;
{ Wrong OS or OS version for application }
CO_E_WRONGOSFORAPP = $800401FA;
{ Object is not registered }
CO_E_OBJNOTREG = $800401FB;
{ Object is already registered }
CO_E_OBJISREG = $800401FC;
{ Object is not connected to server }
CO_E_OBJNOTCONNECTED = $800401FD;
{ Application was launched but it didn't register a class factory }
CO_E_APPDIDNTREG = $800401FE;
{ Object has been released }
CO_E_RELEASED = $800401FF;
{ Use the registry database to provide the requested information }
OLE_S_USEREG = $00040000;
{ Success, but static }
OLE_S_STATIC = $00040001;
{ Macintosh clipboard format }
OLE_S_MAC_CLIPFORMAT = $00040002;
{ Successful drop took place }
DRAGDROP_S_DROP = $00040100;
{ Drag-drop operation canceled }
DRAGDROP_S_CANCEL = $00040101;
{ Use the default cursor }
DRAGDROP_S_USEDEFAULTCURSORS = $00040102;
{ Data has same FORMATETC }
DATA_S_SAMEFORMATETC = $00040130;
{ View is already frozen }
VIEW_S_ALREADY_FROZEN = $00040140;
{ FORMATETC not supported }
CACHE_S_FORMATETC_NOTSUPPORTED = $00040170;
{ Same cache }
CACHE_S_SAMECACHE = $00040171;
{ Some cache(s) not updated }
CACHE_S_SOMECACHES_NOTUPDATED = $00040172;
{ Invalid verb for OLE object }
OLEOBJ_S_INVALIDVERB = $00040180;
{ Verb number is valid but verb cannot be done now }
OLEOBJ_S_CANNOT_DOVERB_NOW = $00040181;
{ Invalid window handle passed }
OLEOBJ_S_INVALIDHWND = $00040182;
{ Message is too long; some of it had to be truncated before displaying }
INPLACE_S_TRUNCATED = $000401A0;
{ Unable to convert OLESTREAM to IStorage }
CONVERT10_S_NO_PRESENTATION = $000401C0;
{ Moniker reduced to itself }
MK_S_REDUCED_TO_SELF = $000401E2;
{ Common prefix is this moniker }
MK_S_ME = $000401E4;
{ Common prefix is input moniker }
MK_S_HIM = $000401E5;
{ Common prefix is both monikers }
MK_S_US = $000401E6;
{ Moniker is already registered in running object table }
MK_S_MONIKERALREADYREGISTERED = $000401E7;
{ Attempt to create a class object failed }
CO_E_CLASS_CREATE_FAILED = $80080001;
{ OLE service could not bind object }
CO_E_SCM_ERROR = $80080002;
{ RPC communication failed with OLE service }
CO_E_SCM_RPC_FAILURE = $80080003;
{ Bad path to object }
CO_E_BAD_PATH = $80080004;
{ Server execution failed }
CO_E_SERVER_EXEC_FAILURE = $80080005;
{ OLE service could not communicate with the object server }
CO_E_OBJSRV_RPC_FAILURE = $80080006;
{ Moniker path could not be normalized }
MK_E_NO_NORMALIZED = $80080007;
{ Object server is stopping when OLE service contacts it }
CO_E_SERVER_STOPPING = $80080008;
{ An invalid root block pointer was specified }
MEM_E_INVALID_ROOT = $80080009;
{ An allocation chain contained an invalid link pointer }
MEM_E_INVALID_LINK = $80080010;
{ The requested allocation size was too large }
MEM_E_INVALID_SIZE = $80080011;
{ Unknown interface. }
DISP_E_UNKNOWNINTERFACE = $80020001;
{ Member not found. }
DISP_E_MEMBERNOTFOUND = $80020003;
{ Parameter not found. }
DISP_E_PARAMNOTFOUND = $80020004;
{ Type mismatch. }
DISP_E_TYPEMISMATCH = $80020005;
{ Unknown name. }
DISP_E_UNKNOWNNAME = $80020006;
{ No named arguments. }
DISP_E_NONAMEDARGS = $80020007;
{ Bad variable type. }
DISP_E_BADVARTYPE = $80020008;
{ Exception occurred. }
DISP_E_EXCEPTION = $80020009;
{ Out of present range. }
DISP_E_OVERFLOW = $8002000A;
{ Invalid index. }
DISP_E_BADINDEX = $8002000B;
{ Unknown language. }
DISP_E_UNKNOWNLCID = $8002000C;
{ Memory is locked. }
DISP_E_ARRAYISLOCKED = $8002000D;
{ Invalid number of parameters. }
DISP_E_BADPARAMCOUNT = $8002000E;
{ Parameter not optional. }
DISP_E_PARAMNOTOPTIONAL = $8002000F;
{ Invalid callee. }
DISP_E_BADCALLEE = $80020010;
{ Does not support a collection. }
DISP_E_NOTACOLLECTION = $80020011;
{ Buffer too small. }
TYPE_E_BUFFERTOOSMALL = $80028016;
{ Old format or invalid type library. }
TYPE_E_INVDATAREAD = $80028018;
{ Old format or invalid type library. }
TYPE_E_UNSUPFORMAT = $80028019;
{ Error accessing the OLE registry. }
TYPE_E_REGISTRYACCESS = $8002801C;
{ Library not registered. }
TYPE_E_LIBNOTREGISTERED = $8002801D;
{ Bound to unknown type. }
TYPE_E_UNDEFINEDTYPE = $80028027;
{ Qualified name disallowed. }
TYPE_E_QUALIFIEDNAMEDISALLOWED = $80028028;
{ Invalid forward reference, or reference to uncompiled type. }
TYPE_E_INVALIDSTATE = $80028029;
{ Type mismatch. }
TYPE_E_WRONGTYPEKIND = $8002802A;
{ Element not found. }
TYPE_E_ELEMENTNOTFOUND = $8002802B;
{ Ambiguous name. }
TYPE_E_AMBIGUOUSNAME = $8002802C;
{ Name already exists in the library. }
TYPE_E_NAMECONFLICT = $8002802D;
{ Unknown LCID. }
TYPE_E_UNKNOWNLCID = $8002802E;
{ Function not defined in specified DLL. }
TYPE_E_DLLFUNCTIONNOTFOUND = $8002802F;
{ Wrong module kind for the operation. }
TYPE_E_BADMODULEKIND = $800288BD;
{ Size may not exceed 64K. }
TYPE_E_SIZETOOBIG = $800288C5;
{ Duplicate ID in inheritance hierarchy. }
TYPE_E_DUPLICATEID = $800288C6;
{ Incorrect inheritance depth in standard OLE hmember. }
TYPE_E_INVALIDID = $800288CF;
{ Type mismatch. }
TYPE_E_TYPEMISMATCH = $80028CA0;
{ Invalid number of arguments. }
TYPE_E_OUTOFBOUNDS = $80028CA1;
{ I/O Error. }
TYPE_E_IOERROR = $80028CA2;
{ Error creating unique tmp file. }
TYPE_E_CANTCREATETMPFILE = $80028CA3;
{ Error loading type library/DLL. }
TYPE_E_CANTLOADLIBRARY = $80029C4A;
{ Inconsistent property functions. }
TYPE_E_INCONSISTENTPROPFUNCS = $80029C83;
{ Circular dependency between types/modules. }
TYPE_E_CIRCULARTYPE = $80029C84;
{ Unable to perform requested operation. }
STG_E_INVALIDFUNCTION = $80030001;
{ %s could not be found. }
STG_E_FILENOTFOUND = $80030002;
{ The path %s could not be found. }
STG_E_PATHNOTFOUND = $80030003;
{ There are insufficient resources to open another file. }
STG_E_TOOMANYOPENFILES = $80030004;
{ Access Denied. }
STG_E_ACCESSDENIED = $80030005;
{ Attempted an operation on an invalid object. }
STG_E_INVALIDHANDLE = $80030006;
{ There is insufficient memory available to complete operation. }
STG_E_INSUFFICIENTMEMORY = $80030008;
{ Invalid pointer error. }
STG_E_INVALIDPOINTER = $80030009;
{ There are no more entries to return. }
STG_E_NOMOREFILES = $80030012;
{ Disk is write-protected. }
STG_E_DISKISWRITEPROTECTED = $80030013;
{ An error occurred during a seek operation. }
STG_E_SEEKERROR = $80030019;
{ A disk error occurred during a write operation. }
STG_E_WRITEFAULT = $8003001D;
{ A disk error occurred during a read operation. }
STG_E_READFAULT = $8003001E;
{ A share violation has occurred. }
STG_E_SHAREVIOLATION = $80030020;
{ A lock violation has occurred. }
STG_E_LOCKVIOLATION = $80030021;
{ %s already exists. }
STG_E_FILEALREADYEXISTS = $80030050;
{ Invalid parameter error. }
STG_E_INVALIDPARAMETER = $80030057;
{ There is insufficient disk space to complete operation. }
STG_E_MEDIUMFULL = $80030070;
{ An API call exited abnormally. }
STG_E_ABNORMALAPIEXIT = $800300FA;
{ The file %s is not a valid compound file. }
STG_E_INVALIDHEADER = $800300FB;
{ The name %s is not valid. }
STG_E_INVALIDNAME = $800300FC;
{ An unexpected error occurred. }
STG_E_UNKNOWN = $800300FD;
{ That function is not implemented. }
STG_E_UNIMPLEMENTEDFUNCTION = $800300FE;
{ Invalid flag error. }
STG_E_INVALIDFLAG = $800300FF;
{ Attempted to use an object that is busy. }
STG_E_INUSE = $80030100;
{ The storage has been changed since the last commit. }
STG_E_NOTCURRENT = $80030101;
{ Attempted to use an object that has ceased to exist. }
STG_E_REVERTED = $80030102;
{ Can't save. }
STG_E_CANTSAVE = $80030103;
{ The compound file %s was produced with an incompatible version of storage }
STG_E_OLDFORMAT = $80030104;
{ The compound file %s was produced with a newer version of storage. }
STG_E_OLDDLL = $80030105;
{ Share.exe or equivalent is required for operation. }
STG_E_SHAREREQUIRED = $80030106;
{ Illegal operation called on non-file based storage. }
STG_E_NOTFILEBASEDSTORAGE = $80030107;
{ Illegal operation called on object with extant marshallings. }
STG_E_EXTANTMARSHALLINGS = $80030108;
{ The underlying file was converted to compound file format. }
STG_S_CONVERTED = $00030200;
{ Call was rejected by callee. }
RPC_E_CALL_REJECTED = $80010001;
{ Call was canceled by the message filter. }
RPC_E_CALL_CANCELED = $80010002;
{ The caller is dispatching an intertask SendMessage call and cannot
call out via PostMessage. }
RPC_E_CANTPOST_INSENDCALL = $80010003;
{ The caller is dispatching an asynchronous call and cannot make an
outgoing call on behalf of this call. }
RPC_E_CANTCALLOUT_INASYNCCALL = $80010004;
{ It is illegal to call out while inside message filter. }
RPC_E_CANTCALLOUT_INEXTERNALCALL = $80010005;
{ The connection terminated or is in a bogus state and cannot be used
any more. Other connections are still valid. }
RPC_E_CONNECTION_TERMINATED = $80010006;
{ The callee (server [not server application]) is not available and
disappeared; all connections are invalid. The call may have executed. }
RPC_E_SERVER_DIED = $80010007;
{ The caller (client) disappeared while the callee (server) was processing
a call. }
RPC_E_CLIENT_DIED = $80010008;
{ The data packet with the marshalled parameter data is incorrect. }
RPC_E_INVALID_DATAPACKET = $80010009;
{ The call was not transmitted properly; the message queue was full and
was not emptied after yielding. }
RPC_E_CANTTRANSMIT_CALL = $8001000A;
{ The client (caller) cannot marshall the parameter data - low memory, etc. }
RPC_E_CLIENT_CANTMARSHAL_DATA = $8001000B;
{ The client (caller) cannot unmarshall the return data - low memory, etc. }
RPC_E_CLIENT_CANTUNMARSHAL_DATA = $8001000C;
{ The server (callee) cannot marshall the return data - low memory, etc. }
RPC_E_SERVER_CANTMARSHAL_DATA = $8001000D;
{ The server (callee) cannot unmarshall the parameter data - low memory, etc. }
RPC_E_SERVER_CANTUNMARSHAL_DATA = $8001000E;
{ Received data is invalid; could be server or client data. }
RPC_E_INVALID_DATA = $8001000F;
{ A particular parameter is invalid and cannot be (un)marshalled. }
RPC_E_INVALID_PARAMETER = $80010010;
{ There is no second outgoing call on same channel in DDE conversation. }
RPC_E_CANTCALLOUT_AGAIN = $80010011;
{ The callee (server [not server application]) is not available and
disappeared; all connections are invalid. The call did not execute. }
RPC_E_SERVER_DIED_DNE = $80010012;
{ System call failed. }
RPC_E_SYS_CALL_FAILED = $80010100;
{ Could not allocate some required resource (memory, events, ...) }
RPC_E_OUT_OF_RESOURCES = $80010101;
{ Attempted to make calls on more than one thread in single threaded mode. }
RPC_E_ATTEMPTED_MULTITHREAD = $80010102;
{ The requested interface is not registered on the server object. }
RPC_E_NOT_REGISTERED = $80010103;
{ RPC could not call the server or could not return the results of calling
the server. }
RPC_E_FAULT = $80010104;
{ The server threw an exception. }
RPC_E_SERVERFAULT = $80010105;
{ Cannot change thread mode after it is set. }
RPC_E_CHANGED_MODE = $80010106;
{ The method called does not exist on the server. }
RPC_E_INVALIDMETHOD = $80010107;
{ The object invoked has disconnected from its clients. }
RPC_E_DISCONNECTED = $80010108;
{ The object invoked chose not to process the call now. Try again later. }
RPC_E_RETRY = $80010109;
{ The message filter indicated that the application is busy. }
RPC_E_SERVERCALL_RETRYLATER = $8001010A;
{ The message filter rejected the call. }
RPC_E_SERVERCALL_REJECTED = $8001010B;
{ A call control interfaces was called with invalid data. }
RPC_E_INVALID_CALLDATA = $8001010C;
{ An outgoing call cannot be made since the application is dispatching
an input-synchronous call. }
RPC_E_CANTCALLOUT_ININPUTSYNCCALL = $8001010D;
{ The application called an interface that was marshalled for a different
thread. }
RPC_E_WRONG_THREAD = $8001010E;
{ CoInitialize has not been called on the current thread. }
RPC_E_THREAD_NOT_INIT = $8001010F;
{ An internal error occurred. }
RPC_E_UNEXPECTED = $8001FFFF;
{ CONSTANTS }
MEMCTX_TASK = 1;
MEMCTX_SHARED = 2;
MEMCTX_MACSYSTEM = 3;
MEMCTX_UNKNOWN = -1;
MEMCTX_SAME = -2;
ROTFLAGS_REGISTRATIONKEEPSALIVE = 1;
CLSCTX_INPROC_SERVER = 1;
CLSCTX_INPROC_HANDLER = 2;
CLSCTX_LOCAL_SERVER = 4;
CLSCTX_INPROC_SERVER16 = 8;
CLSCTX_ALL = CLSCTX_INPROC_SERVER or CLSCTX_INPROC_HANDLER or
CLSCTX_LOCAL_SERVER;
CLSCTX_INPROC = CLSCTX_INPROC_SERVER or CLSCTX_INPROC_HANDLER;
CLSCTX_SERVER = CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER;
MSHLFLAGS_NORMAL = 0;
MSHLFLAGS_TABLESTRONG = 1;
MSHLFLAGS_TABLEWEAK = 2;
MSHCTX_LOCAL = 0;
MSHCTX_NOSHAREDMEM = 1;
MSHCTX_DIFFERENTMACHINE = 2;
MSHCTX_INPROC = 3;
DVASPECT_CONTENT = 1;
DVASPECT_THUMBNAIL = 2;
DVASPECT_ICON = 4;
DVASPECT_DOCPRINT = 8;
STGC_DEFAULT = 0;
STGC_OVERWRITE = 1;
STGC_ONLYIFCURRENT = 2;
STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4;
STGMOVE_MOVE = 0;
STGMOVE_COPY = 1;
STATFLAG_DEFAULT = 0;
STATFLAG_NONAME = 1;
BIND_MAYBOTHERUSER = 1;
BIND_JUSTTESTEXISTENCE = 2;
MKSYS_NONE = 0;
MKSYS_GENERICCOMPOSITE = 1;
MKSYS_FILEMONIKER = 2;
MKSYS_ANTIMONIKER = 3;
MKSYS_ITEMMONIKER = 4;
MKSYS_POINTERMONIKER = 5;
MKRREDUCE_ONE = 3 shl 16;
MKRREDUCE_TOUSER = 2 shl 16;
MKRREDUCE_THROUGHUSER = 1 shl 16;
MKRREDUCE_ALL = 0;
STGTY_STORAGE = 1;
STGTY_STREAM = 2;
STGTY_LOCKBYTES = 3;
STGTY_PROPERTY = 4;
STREAM_SEEK_SET = 0;
STREAM_SEEK_CUR = 1;
STREAM_SEEK_END = 2;
LOCK_WRITE = 1;
LOCK_EXCLUSIVE = 2;
LOCK_ONLYONCE = 4;
ADVF_NODATA = 1;
ADVF_PRIMEFIRST = 2;
ADVF_ONLYONCE = 4;
ADVF_DATAONSTOP = 64;
ADVFCACHE_NOHANDLER = 8;
ADVFCACHE_FORCEBUILTIN = 16;
ADVFCACHE_ONSAVE = 32;
TYMED_HGLOBAL = 1;
TYMED_FILE = 2;
TYMED_ISTREAM = 4;
TYMED_ISTORAGE = 8;
TYMED_GDI = 16;
TYMED_MFPICT = 32;
TYMED_ENHMF = 64;
TYMED_NULL = 0;
DATADIR_GET = 1;
DATADIR_SET = 2;
CALLTYPE_TOPLEVEL = 1;
CALLTYPE_NESTED = 2;
CALLTYPE_ASYNC = 3;
CALLTYPE_TOPLEVEL_CALLPENDING = 4;
CALLTYPE_ASYNC_CALLPENDING = 5;
SERVERCALL_ISHANDLED = 0;
SERVERCALL_REJECTED = 1;
SERVERCALL_RETRYLATER = 2;
PENDINGTYPE_TOPLEVEL = 1;
PENDINGTYPE_NESTED = 2;
PENDINGMSG_CANCELCALL = 0;
PENDINGMSG_WAITNOPROCESS = 1;
PENDINGMSG_WAITDEFPROCESS = 2;
REGCLS_SINGLEUSE = 0;
REGCLS_MULTIPLEUSE = 1;
REGCLS_MULTI_SEPARATE = 2;
MARSHALINTERFACE_MIN = 500;
CWCSTORAGENAME = 32;
STGM_DIRECT = $00000000;
STGM_TRANSACTED = $00010000;
STGM_SIMPLE = $08000000;
STGM_READ = $00000000;
STGM_WRITE = $00000001;
STGM_READWRITE = $00000002;
STGM_SHARE_DENY_NONE = $00000040;
STGM_SHARE_DENY_READ = $00000030;
STGM_SHARE_DENY_WRITE = $00000020;
STGM_SHARE_EXCLUSIVE = $00000010;
STGM_PRIORITY = $00040000;
STGM_DELETEONRELEASE = $04000000;
STGM_CREATE = $00001000;
STGM_CONVERT = $00020000;
STGM_FAILIFTHERE = $00000000;
FADF_AUTO = $0001; { array is allocated on the stack }
FADF_STATIC = $0002; { array is staticly allocated }
FADF_EMBEDDED = $0004; { array is embedded in a structure }
FADF_FIXEDSIZE = $0010; { array may not be resized or reallocated }
FADF_BSTR = $0100; { an array of BSTRs }
FADF_UNKNOWN = $0200; { an array of IUnknown }
FADF_DISPATCH = $0400; { an array of IDispatch }
FADF_VARIANT = $0800; { an array of VARIANTs }
FADF_RESERVED = $F0E8; { bits reserved for future use }
{ VARENUM usage key,
[V] - may appear in a VARIANT
[T] - may appear in a TYPEDESC
[P] - may appear in an OLE property set
[S] - may appear in a Safe Array }
VT_EMPTY = 0; { [V] [P] nothing }
VT_NULL = 1; { [V] SQL style Null }
VT_I2 = 2; { [V][T][P] 2 byte signed int }
VT_I4 = 3; { [V][T][P] 4 byte signed int }
VT_R4 = 4; { [V][T][P] 4 byte real }
VT_R8 = 5; { [V][T][P] 8 byte real }
VT_CY = 6; { [V][T][P] currency }
VT_DATE = 7; { [V][T][P] date }
VT_BSTR = 8; { [V][T][P] binary string }
VT_DISPATCH = 9; { [V][T] IDispatch FAR* }
VT_ERROR = 10; { [V][T] SCODE }
VT_BOOL = 11; { [V][T][P] True=-1, False=0 }
VT_VARIANT = 12; { [V][T][P] VARIANT FAR* }
VT_UNKNOWN = 13; { [V][T] IUnknown FAR* }
VT_I1 = 16; { [T] signed char }
VT_UI1 = 17; { [T] unsigned char }
VT_UI2 = 18; { [T] unsigned short }
VT_UI4 = 19; { [T] unsigned short }
VT_I8 = 20; { [T][P] signed 64-bit int }
VT_UI8 = 21; { [T] unsigned 64-bit int }
VT_INT = 22; { [T] signed machine int }
VT_UINT = 23; { [T] unsigned machine int }
VT_VOID = 24; { [T] C style void }
VT_HRESULT = 25; { [T] }
VT_PTR = 26; { [T] pointer type }
VT_SAFEARRAY = 27; { [T] (use VT_ARRAY in VARIANT) }
VT_CARRAY = 28; { [T] C style array }
VT_USERDEFINED = 29; { [T] user defined type }
VT_LPSTR = 30; { [T][P] null terminated string }
VT_LPWSTR = 31; { [T][P] wide null terminated string }
VT_FILETIME = 64; { [P] FILETIME }
VT_BLOB = 65; { [P] Length prefixed bytes }
VT_STREAM = 66; { [P] Name of the stream follows }
VT_STORAGE = 67; { [P] Name of the storage follows }
VT_STREAMED_OBJECT = 68; { [P] Stream contains an object }
VT_STORED_OBJECT = 69; { [P] Storage contains an object }
VT_BLOB_OBJECT = 70; { [P] Blob contains an object }
VT_CF = 71; { [P] Clipboard format }
VT_CLSID = 72; { [P] A Class ID }
VT_VECTOR = $1000; { [P] simple counted array }
VT_ARRAY = $2000; { [V] SAFEARRAY* }
VT_BYREF = $4000; { [V] }
VT_RESERVED = $8000;
TKIND_ENUM = 0;
TKIND_RECORD = 1;
TKIND_MODULE = 2;
TKIND_INTERFACE = 3;
TKIND_DISPATCH = 4;
TKIND_COCLASS = 5;
TKIND_ALIAS = 6;
TKIND_UNION = 7;
TKIND_MAX = 8;
CC_CDECL = 1;
CC_PASCAL = 2;
CC_MACPASCAL = 3;
CC_STDCALL = 4;
CC_RESERVED = 5;
CC_SYSCALL = 6;
CC_MPWCDECL = 7;
CC_MPWPASCAL = 8;
CC_MAX = 9;
FUNC_VIRTUAL = 0;
FUNC_PUREVIRTUAL = 1;
FUNC_NONVIRTUAL = 2;
FUNC_STATIC = 3;
FUNC_DISPATCH = 4;
INVOKE_FUNC = 1;
INVOKE_PROPERTYGET = 2;
INVOKE_PROPERTYPUT = 4;
INVOKE_PROPERTYPUTREF = 8;
VAR_PERINSTANCE = 0;
VAR_STATIC = 1;
VAR_CONST = 2;
VAR_DISPATCH = 3;
IMPLTYPEFLAG_FDEFAULT = 1;
IMPLTYPEFLAG_FSOURCE = 2;
IMPLTYPEFLAG_FRESTRICTED = 4;
TYPEFLAG_FAPPOBJECT = $0001;
TYPEFLAG_FCANCREATE = $0002;
TYPEFLAG_FLICENSED = $0004;
TYPEFLAG_FPREDECLID = $0008;
TYPEFLAG_FHIDDEN = $0010;
TYPEFLAG_FCONTROL = $0020;
TYPEFLAG_FDUAL = $0040;
TYPEFLAG_FNONEXTENSIBLE = $0080;
TYPEFLAG_FOLEAUTOMATION = $0100;
FUNCFLAG_FRESTRICTED = $0001;
FUNCFLAG_FSOURCE = $0002;
FUNCFLAG_FBINDABLE = $0004;
FUNCFLAG_FREQUESTEDIT = $0008;
FUNCFLAG_FDISPLAYBIND = $0010;
FUNCFLAG_FDEFAULTBIND = $0020;
FUNCFLAG_FHIDDEN = $0040;
VARFLAG_FREADONLY = $0001;
VARFLAG_FSOURCE = $0002;
VARFLAG_FBINDABLE = $0004;
VARFLAG_FREQUESTEDIT = $0008;
VARFLAG_FDISPLAYBIND = $0010;
VARFLAG_FDEFAULTBIND = $0020;
VARFLAG_FHIDDEN = $0040;
DISPID_VALUE = 0;
DISPID_UNKNOWN = -1;
DISPID_PROPERTYPUT = -3;
DISPID_NEWENUM = -4;
DISPID_EVALUATE = -5;
DISPID_CONSTRUCTOR = -6;
DISPID_DESTRUCTOR = -7;
DISPID_COLLECT = -8;
DESCKIND_NONE = 0;
DESCKIND_FUNCDESC = 1;
DESCKIND_VARDESC = 2;
DESCKIND_TYPECOMP = 3;
DESCKIND_IMPLICITAPPOBJ = 4;
DESCKIND_MAX = 5;
SYS_WIN16 = 0;
SYS_WIN32 = 1;
SYS_MAC = 2;
LIBFLAG_FRESTRICTED = 1;
LIBFLAG_FCONTROL = 2;
LIBFLAG_FHIDDEN = 4;
STDOLE_MAJORVERNUM = 1;
STDOLE_MINORVERNUM = 0;
STDOLE_LCID = 0;
VARIANT_NOVALUEPROP = 1;
VAR_TIMEVALUEONLY = 1;
VAR_DATEVALUEONLY = 2;
MEMBERID_NIL = DISPID_UNKNOWN;
ID_DEFAULTINST = -2;
IDLFLAG_NONE = 0;
IDLFLAG_FIN = 1;
IDLFLAG_FOUT = 2;
IDLFLAG_FLCID = 4;
IDLFLAG_FRETVAL = 8;
DISPATCH_METHOD = 1;
DISPATCH_PROPERTYGET = 2;
DISPATCH_PROPERTYPUT = 4;
DISPATCH_PROPERTYPUTREF = 8;
OLEIVERB_PRIMARY = 0;
OLEIVERB_SHOW = -1;
OLEIVERB_OPEN = -2;
OLEIVERB_HIDE = -3;
OLEIVERB_UIACTIVATE = -4;
OLEIVERB_INPLACEACTIVATE = -5;
OLEIVERB_DISCARDUNDOSTATE = -6;
EMBDHLP_INPROC_HANDLER = $00000000;
EMBDHLP_INPROC_SERVER = $00000001;
EMBDHLP_CREATENOW = $00000000;
EMBDHLP_DELAYCREATE = $00010000;
UPDFCACHE_NODATACACHE = 1;
UPDFCACHE_ONSAVECACHE = 2;
UPDFCACHE_ONSTOPCACHE = 4;
UPDFCACHE_NORMALCACHE = 8;
UPDFCACHE_IFBLANK = $10;
UPDFCACHE_ONLYIFBLANK = $80000000;
UPDFCACHE_IFBLANKORONSAVECACHE = UPDFCACHE_IFBLANK or UPDFCACHE_ONSAVECACHE;
UPDFCACHE_ALL = not UPDFCACHE_ONLYIFBLANK;
UPDFCACHE_ALLBUTNODATACACHE = UPDFCACHE_ALL and not UPDFCACHE_NODATACACHE;
DISCARDCACHE_SAVEIFDIRTY = 0;
DISCARDCACHE_NOSAVE = 1;
OLEGETMONIKER_ONLYIFTHERE = 1;
OLEGETMONIKER_FORCEASSIGN = 2;
OLEGETMONIKER_UNASSIGN = 3;
OLEGETMONIKER_TEMPFORUSER = 4;
OLEWHICHMK_CONTAINER = 1;
OLEWHICHMK_OBJREL = 2;
OLEWHICHMK_OBJFULL = 3;
USERCLASSTYPE_FULL = 1;
USERCLASSTYPE_SHORT = 2;
USERCLASSTYPE_APPNAME = 3;
OLEMISC_RECOMPOSEONRESIZE = 1;
OLEMISC_ONLYICONIC = 2;
OLEMISC_INSERTNOTREPLACE = 4;
OLEMISC_STATIC = 8;
OLEMISC_CANTLINKINSIDE = 16;
OLEMISC_CANLINKBYOLE1 = 32;
OLEMISC_ISLINKOBJECT = 64;
OLEMISC_INSIDEOUT = 128;
OLEMISC_ACTIVATEWHENVISIBLE = 256;
OLEMISC_RENDERINGISDEVICEINDEPENDENT = 512;
OLECLOSE_SAVEIFDIRTY = 0;
OLECLOSE_NOSAVE = 1;
OLECLOSE_PROMPTSAVE = 2;
OLERENDER_NONE = 0;
OLERENDER_DRAW = 1;
OLERENDER_FORMAT = 2;
OLERENDER_ASIS = 3;
OLEUPDATE_ALWAYS = 1;
OLEUPDATE_ONCALL = 3;
OLELINKBIND_EVENIFCLASSDIFF = 1;
BINDSPEED_INDEFINITE = 1;
BINDSPEED_MODERATE = 2;
BINDSPEED_IMMEDIATE = 3;
OLECONTF_EMBEDDINGS = 1;
OLECONTF_LINKS = 2;
OLECONTF_OTHERS = 4;
OLECONTF_ONLYUSER = 8;
OLECONTF_ONLYIFRUNNING = 16;
DROPEFFECT_NONE = 0;
DROPEFFECT_COPY = 1;
DROPEFFECT_MOVE = 2;
DROPEFFECT_LINK = 4;
DROPEFFECT_SCROLL = $80000000;
DD_DEFSCROLLINSET = 11;
DD_DEFSCROLLDELAY = 50;
DD_DEFSCROLLINTERVAL = 50;
DD_DEFDRAGDELAY = 200;
DD_DEFDRAGMINDIST = 2;
OLEVERBATTRIB_NEVERDIRTIES = 1;
OLEVERBATTRIB_ONCONTAINERMENU = 2;
type
{ Result code }
HResult = Longint;
PResultList = ^TResultList;
TResultList = array[0..65535] of HResult;
{ OLE character and string types }
TOleChar = WideChar;
POleStr = PWideChar;
POleStrList = ^TOleStrList;
TOleStrList = array[0..65535] of POleStr;
{ 64-bit large integer }
Largeint = Comp;
{ Globally unique ID }
PGUID = ^TGUID;
_GUID = record
D1: Longint;
D2: Word;
D3: Word;
D4: array[0..7] of Byte;
end;
{$nonamespace _GUID}
TGUID = _GUID;
{ Interface ID }
PIID = PGUID;
TIID = TGUID;
{ Class ID }
PCLSID = PGUID;
TCLSID = TGUID;
{ Object ID }
PObjectID = ^TObjectID;
_OBJECTID = record
Lineage: TGUID;
Uniquifier: Longint;
end;
{$nonamespace _OBJECTID}
TObjectID = _OBJECTID;
{ Locale ID }
TLCID = Longint;
{ Forward declarations }
IStream = class;
IRunningObjectTable = class;
IEnumString = class;
IMoniker = class;
IAdviseSink = class;
IDispatch = class;
ITypeInfo = class;
ITypeComp = class;
ITypeLib = class;
IEnumOleVerb = class;
IOleInPlaceActiveObject = class;
{ IUnknown interface }
IUnknown = class
public
function QueryInterface(const iid: TIID; var obj): HResult; virtual; stdcall; abstract;
function AddRef: Longint; virtual; stdcall; abstract;
function Release: Longint; virtual; stdcall; abstract;
end;
{ IClassFactory interface }
IClassFactory = class(IUnknown)
public
function CreateInstance(unkOuter: IUnknown; const iid: TIID;
var obj): HResult; virtual; stdcall; abstract;
function LockServer(fLock: BOOL): HResult; virtual; stdcall; abstract;
end;
{ IMarshal interface }
IMarshal = class(IUnknown)
public
function GetUnmarshalClass(const iid: TIID; pv: Pointer;
dwDestContext: Longint; pvDestContext: Pointer; mshlflags: Longint;
var cid: TCLSID): HResult; virtual; stdcall; abstract;
function GetMarshalSizeMax(const iid: TIID; pv: Pointer;
dwDestContext: Longint; pvDestContext: Pointer; mshlflags: Longint;
var size: Longint): HResult; virtual; stdcall; abstract;
function MarshalInterface(stm: IStream; const iid: TIID; pv: Pointer;
dwDestContext: Longint; pvDestContext: Pointer;
mshlflags: Longint): HResult; virtual; stdcall; abstract;
function UnmarshalInterface(stm: IStream; const iid: TIID;
var pv): HResult; virtual; stdcall; abstract;
function ReleaseMarshalData(stm: IStream): HResult;
virtual; stdcall; abstract;
function DisconnectObject(dwReserved: Longint): HResult;
virtual; stdcall; abstract;
end;
{ IMalloc interface }
IMalloc = class(IUnknown)
public
function Alloc(cb: Longint): Pointer; virtual; stdcall; abstract;
function Realloc(pv: Pointer; cb: Longint): Pointer; virtual; stdcall; abstract;
procedure Free(pv: Pointer); virtual; stdcall; abstract;
function GetSize(pv: Pointer): Longint; virtual; stdcall; abstract;
function DidAlloc(pv: Pointer): Integer; virtual; stdcall; abstract;
procedure HeapMinimize; virtual; stdcall; abstract;
end;
{ IMallocSpy interface }
IMallocSpy = class(IUnknown)
public
function PreAlloc(cbRequest: Longint): Longint; virtual; stdcall; abstract;
function PostAlloc(pActual: Pointer): Pointer; virtual; stdcall; abstract;
function PreFree(pRequest: Pointer; fSpyed: BOOL): Pointer; virtual; stdcall; abstract;
procedure PostFree(fSpyed: BOOL); virtual; stdcall; abstract;
function PreRealloc(pRequest: Pointer; cbRequest: Longint;
var ppNewRequest: Pointer; fSpyed: BOOL): Longint; virtual; stdcall; abstract;
function PostRealloc(pActual: Pointer; fSpyed: BOOL): Pointer; virtual; stdcall; abstract;
function PreGetSize(pRequest: Pointer; fSpyed: BOOL): Pointer; virtual; stdcall; abstract;
function PostGetSize(pActual: Pointer; fSpyed: BOOL): Longint; virtual; stdcall; abstract;
function PostDidAlloc(pRequest: Pointer; fSpyed: BOOL; fActual: Integer): Integer; virtual; stdcall; abstract;
procedure PreHeapMinimize; virtual; stdcall; abstract;
procedure PostHeapMinimize; virtual; stdcall; abstract;
end;
{ IStdMarshalInfo interface }
IStdMarshalInfo = class(IUnknown)
public
function GetClassForHandler(dwDestContext: Longint; pvDestContext: Pointer;
var clsid: TCLSID): HResult; virtual; stdcall; abstract;
end;
{ IExternalConnection interface }
IExternalConnection = class(IUnknown)
public
function AddConnection(extconn: Longint; reserved: Longint): Longint;
virtual; stdcall; abstract;
function ReleaseConnection(extconn: Longint; reserved: Longint;
fLastReleaseCloses: BOOL): Longint; virtual; stdcall; abstract;
end;
{ IWeakRef interface }
IWeakRef = class(IUnknown)
public
function ChangeWeakCount(delta: Longint): Longint; virtual; stdcall; abstract;
function ReleaseKeepAlive(unkReleased: IUnknown;
reserved: Longint): Longint; virtual; stdcall; abstract;
end;
{ IEnumUnknown interface }
IEnumUnknown = class(IUnknown)
public
function Next(celt: Longint; var elt;
pceltFetched: PLongint): HResult; virtual; stdcall; abstract;
function Skip(celt: Longint): HResult; virtual; stdcall; abstract;
function Reset: HResult; virtual; stdcall; abstract;
function Clone(var enm: IEnumUnknown): HResult; virtual; stdcall; abstract;
end;
{ IBindCtx interface }
PBindOpts = ^TBindOpts;
tagBIND_OPTS = record
cbStruct: Longint;
grfFlags: Longint;
grfMode: Longint;
dwTickCountDeadline: Longint;
end;
{$nonamespace tagBIND_OPTS}
TBindOpts = tagBIND_OPTS;
IBindCtx = class(IUnknown)
public
function RegisterObjectBound(unk: IUnknown): HResult; virtual; stdcall; abstract;
function RevokeObjectBound(unk: IUnknown): HResult; virtual; stdcall; abstract;
function ReleaseBoundObjects: HResult; virtual; stdcall; abstract;
function SetBindOptions(var bindopts: TBindOpts): HResult; virtual; stdcall; abstract;
function GetBindOptions(var bindopts: TBindOpts): HResult; virtual; stdcall; abstract;
function GetRunningObjectTable(var rot: IRunningObjectTable): HResult;
virtual; stdcall; abstract;
function RegisterObjectParam(pszKey: POleStr; unk: IUnknown): HResult;
virtual; stdcall; abstract;
function GetObjectParam(pszKey: POleStr; var unk: IUnknown): HResult;
virtual; stdcall; abstract;
function EnumObjectParam(var Enum: IEnumString): HResult; virtual; stdcall; abstract;
function RevokeObjectParam(pszKey: POleStr): HResult; virtual; stdcall; abstract;
end;
{ IEnumMoniker interface }
IEnumMoniker = class(IUnknown)
public
function Next(celt: Longint; var elt;
pceltFetched: PLongint): HResult; virtual; stdcall; abstract;
function Skip(celt: Longint): HResult; virtual; stdcall; abstract;
function Reset: HResult; virtual; stdcall; abstract;
function Clone(var enm: IEnumMoniker): HResult; virtual; stdcall; abstract;
end;
{ IRunnableObject interface }
IRunnableObject = class(IUnknown)
public
function GetRunningClass(var clsid: TCLSID): HResult; virtual; stdcall; abstract;
function Run(bc: IBindCtx): HResult; virtual; stdcall; abstract;
function IsRunning: BOOL; virtual; stdcall; abstract;
function LockRunning(fLock: BOOL; fLastUnlockCloses: BOOL): HResult;
virtual; stdcall; abstract;
function SetContainedObject(fContained: BOOL): HResult; virtual; stdcall; abstract;
end;
{ IRunningObjectTable interface }
IRunningObjectTable = class(IUnknown)
public
function Register(grfFlags: Longint; var unkObject: IUnknown;
mkObjectName: IMoniker; var dwRegister: Longint): HResult; virtual; stdcall; abstract;
function Revoke(dwRegister: Longint): HResult; virtual; stdcall; abstract;
function IsRunning(mkObjectName: IMoniker): HResult; virtual; stdcall; abstract;
function GetObject(mkObjectName: IMoniker;
var unkObject: IUnknown): HResult; virtual; stdcall; abstract;
function NoteChangeTime(dwRegister: Longint;
var filetime: TFileTime): HResult; virtual; stdcall; abstract;
function GetTimeOfLastChange(mkObjectName: IMoniker;
var filetime: TFileTime): HResult; virtual; stdcall; abstract;
function EnumRunning(var enumMoniker: IEnumMoniker): HResult; virtual; stdcall; abstract;
end;
{ IPersist interface }
IPersist = class(IUnknown)
public
function GetClassID(var classID: TCLSID): HResult; virtual; stdcall; abstract;
end;
{ IPersistStream interface }
IPersistStream = class(IPersist)
public
function IsDirty: HResult; virtual; stdcall; abstract;
function Load(stm: IStream): HResult; virtual; stdcall; abstract;
function Save(stm: IStream; fClearDirty: BOOL): HResult; virtual; stdcall; abstract;
function GetSizeMax(var cbSize: Largeint): HResult; virtual; stdcall; abstract;
end;
{ IMoniker interface }
IMoniker = class(IPersistStream)
public
function BindToObject(bc: IBindCtx; mkToLeft: IMoniker;
const iidResult: TIID; var vResult): HResult; virtual; stdcall; abstract;
function BindToStorage(bc: IBindCtx; mkToLeft: IMoniker;
const iid: TIID; var vObj): HResult; virtual; stdcall; abstract;
function Reduce(bc: IBindCtx; dwReduceHowFar: Longint;
var mkToLeft: IMoniker; var mkReduced: IMoniker): HResult; virtual; stdcall; abstract;
function ComposeWith(mkRight: IMoniker; fOnlyIfNotGeneric: BOOL;
var mkComposite: IMoniker): HResult; virtual; stdcall; abstract;
function Enum(fForward: BOOL; var enumMoniker: IEnumMoniker): HResult;
virtual; stdcall; abstract;
function IsEqual(mkOtherMoniker: IMoniker): HResult; virtual; stdcall; abstract;
function Hash(var dwHash: Longint): HResult; virtual; stdcall; abstract;
function IsRunning(bc: IBindCtx; mkToLeft: IMoniker;
mkNewlyRunning: IMoniker): HResult; virtual; stdcall; abstract;
function GetTimeOfLastChange(bc: IBindCtx; mkToLeft: IMoniker;
var filetime: TFileTime): HResult; virtual; stdcall; abstract;
function Inverse(var mk: IMoniker): HResult; virtual; stdcall; abstract;
function CommonPrefixWith(mkOther: IMoniker;
var mkPrefix: IMoniker): HResult; virtual; stdcall; abstract;
function RelativePathTo(mkOther: IMoniker;
var mkRelPath: IMoniker): HResult; virtual; stdcall; abstract;
function GetDisplayName(bc: IBindCtx; mkToLeft: IMoniker;
var pszDisplayName: POleStr): HResult; virtual; stdcall; abstract;
function ParseDisplayName(bc: IBindCtx; mkToLeft: IMoniker;
pszDisplayName: POleStr; var chEaten: Longint;
var mkOut: IMoniker): HResult; virtual; stdcall; abstract;
function IsSystemMoniker(var dwMksys: Longint): HResult; virtual; stdcall; abstract;
end;
{ IEnumString interface }
IEnumString = class(IUnknown)
public
function Next(celt: Longint; var elt;
pceltFetched: PLongint): HResult; virtual; stdcall; abstract;
function Skip(celt: Longint): HResult; virtual; stdcall; abstract;
function Reset: HResult; virtual; stdcall; abstract;
function Clone(var enm: IEnumString): HResult; virtual; stdcall; abstract;
end;
{ IStream interface }
PStatStg = ^TStatStg;
tagSTATSTG = record
pwcsName: POleStr;
dwType: Longint;
cbSize: Largeint;
mtime: TFileTime;
ctime: TFileTime;
atime: TFileTime;
grfMode: Longint;
grfLocksSupported: Longint;
clsid: TCLSID;
grfStateBits: Longint;
reserved: Longint;
end;
{$nonamespace tagSTATSTG}
TStatStg = tagSTATSTG;
IStream = class(IUnknown)
public
function Read(pv: Pointer; cb: Longint; pcbRead: PLongint): HResult;
virtual; stdcall; abstract;
function Write(pv: Pointer; cb: Longint; pcbWritten: PLongint): HResult;
virtual; stdcall; abstract;
function Seek(dlibMove: Largeint; dwOrigin: Longint;
var libNewPosition: Largeint): HResult; virtual; stdcall; abstract;
function SetSize(libNewSize: Largeint): HResult; virtual; stdcall; abstract;
function CopyTo(stm: IStream; cb: Largeint; var cbRead: Largeint;
var cbWritten: Largeint): HResult; virtual; stdcall; abstract;
function Commit(grfCommitFlags: Longint): HResult; virtual; stdcall; abstract;
function Revert: HResult; virtual; stdcall; abstract;
function LockRegion(libOffset: Largeint; cb: Largeint;
dwLockType: Longint): HResult; virtual; stdcall; abstract;
function UnlockRegion(libOffset: Largeint; cb: Largeint;
dwLockType: Longint): HResult; virtual; stdcall; abstract;
function Stat(var statstg: TStatStg; grfStatFlag: Longint): HResult;
virtual; stdcall; abstract;
function Clone(var stm: IStream): HResult; virtual; stdcall; abstract;
end;
{ IEnumStatStg interface }
IEnumStatStg = class(IUnknown)
public
function Next(celt: Longint; var elt;
pceltFetched: PLongint): HResult; virtual; stdcall; abstract;
function Skip(celt: Longint): HResult; virtual; stdcall; abstract;
function Reset: HResult; virtual; stdcall; abstract;
function Clone(var enm: IEnumStatStg): HResult; virtual; stdcall; abstract;
end;
{ IStorage interface }
TSNB = ^POleStr;
IStorage = class(IUnknown)
public
function CreateStream(pwcsName: POleStr; grfMode: Longint; reserved1: Longint;
reserved2: Longint; var stm: IStream): HResult; virtual; stdcall; abstract;
function OpenStream(pwcsName: POleStr; reserved1: Pointer; grfMode: Longint;
reserved2: Longint; var stm: IStream): HResult; virtual; stdcall; abstract;
function CreateStorage(pwcsName: POleStr; grfMode: Longint;
dwStgFmt: Longint; reserved2: Longint; var stg: IStorage): HResult;
virtual; stdcall; abstract;
function OpenStorage(pwcsName: POleStr; stgPriority: IStorage;
grfMode: Longint; snbExclude: TSNB; reserved: Longint;
var stg: IStorage): HResult; virtual; stdcall; abstract;
function CopyTo(ciidExclude: Longint; rgiidExclude: PIID;
snbExclude: TSNB; stgDest: IStorage): HResult; virtual; stdcall; abstract;
function MoveElementTo(pwcsName: POleStr; stgDest: IStorage;
pwcsNewName: POleStr; grfFlags: Longint): HResult; virtual; stdcall; abstract;
function Commit(grfCommitFlags: Longint): HResult; virtual; stdcall; abstract;
function Revert: HResult; virtual; stdcall; abstract;
function EnumElements(reserved1: Longint; reserved2: Pointer; reserved3: Longint;
var enm: IEnumStatStg): HResult; virtual; stdcall; abstract;
function DestroyElement(pwcsName: POleStr): HResult; virtual; stdcall; abstract;
function RenameElement(pwcsOldName: POleStr;
pwcsNewName: POleStr): HResult; virtual; stdcall; abstract;
function SetElementTimes(pwcsName: POleStr; const ctime: TFileTime;
const atime: TFileTime; const mtime: TFileTime): HResult;
virtual; stdcall; abstract;
function SetClass(const clsid: TCLSID): HResult; virtual; stdcall; abstract;
function SetStateBits(grfStateBits: Longint; grfMask: Longint): HResult;
virtual; stdcall; abstract;
function Stat(var statstg: TStatStg; grfStatFlag: Longint): HResult;
virtual; stdcall; abstract;
end;
{ IPersistFile interface }
IPersistFile = class(IPersist)
public
function IsDirty: HResult; virtual; stdcall; abstract;
function Load(pszFileName: POleStr; dwMode: Longint): HResult;
virtual; stdcall; abstract;
function Save(pszFileName: POleStr; fRemember: BOOL): HResult;
virtual; stdcall; abstract;
function SaveCompleted(pszFileName: POleStr): HResult;
virtual; stdcall; abstract;
function GetCurFile(var pszFileName: POleStr): HResult;
virtual; stdcall; abstract;
end;
{ IPersistStorage interface }
IPersistStorage = class(IPersist)
public
function IsDirty: HResult; virtual; stdcall; abstract;
function InitNew(stg: IStorage): HResult; virtual; stdcall; abstract;
function Load(stg: IStorage): HResult; virtual; stdcall; abstract;
function Save(stgSave: IStorage; fSameAsLoad: BOOL): HResult;
virtual; stdcall; abstract;
function SaveCompleted(stgNew: IStorage): HResult; virtual; stdcall; abstract;
function HandsOffStorage: HResult; virtual; stdcall; abstract;
end;
{ ILockBytes interface }
ILockBytes = class(IUnknown)
public
function ReadAt(ulOffset: Largeint; pv: Pointer; cb: Longint;
pcbRead: PLongint): HResult; virtual; stdcall; abstract;
function WriteAt(ulOffset: Largeint; pv: Pointer; cb: Longint;
pcbWritten: PLongint): HResult; virtual; stdcall; abstract;
function Flush: HResult; virtual; stdcall; abstract;
function SetSize(cb: Largeint): HResult; virtual; stdcall; abstract;
function LockRegion(libOffset: Largeint; cb: Largeint;
dwLockType: Longint): HResult; virtual; stdcall; abstract;
function UnlockRegion(libOffset: Largeint; cb: Largeint;
dwLockType: Longint): HResult; virtual; stdcall; abstract;
function Stat(var statstg: TStatStg; grfStatFlag: Longint): HResult;
virtual; stdcall; abstract;
end;
{ IEnumFormatEtc interface }
PDVTargetDevice = ^TDVTargetDevice;
tagDVTARGETDEVICE = record
tdSize: Longint;
tdDriverNameOffset: Word;
tdDeviceNameOffset: Word;
tdPortNameOffset: Word;
tdExtDevmodeOffset: Word;
tdData: array[0..0] of Byte;
end;
{$nonamespace tagDVTARGETDEVICE}
TDVTargetDevice = tagDVTARGETDEVICE;
PClipFormat = ^TClipFormat;
TClipFormat = Word;
PFormatEtc = ^TFormatEtc;
tagFORMATETC = record
cfFormat: TClipFormat;
ptd: PDVTargetDevice;
dwAspect: Longint;
lindex: Longint;
tymed: Longint;
end;
{$nonamespace tagFORMATETC}
TFormatEtc = tagFORMATETC;
IEnumFormatEtc = class(IUnknown)
public
function Next(celt: Longint; var elt;
pceltFetched: PLongint): HResult; virtual; stdcall; abstract;
function Skip(celt: Longint): HResult; virtual; stdcall; abstract;
function Reset: HResult; virtual; stdcall; abstract;
function Clone(var Enum: IEnumFormatEtc): HResult; virtual; stdcall; abstract;
end;
{ IEnumStatData interface }
PStatData = ^TStatData;
tagSTATDATA = record
formatetc: TFormatEtc;
advf: Longint;
advSink: IAdviseSink;
dwConnection: Longint;
end;
{$nonamespace tagSTATDATA}
TStatData = tagSTATDATA;
IEnumStatData = class(IUnknown)
public
function Next(celt: Longint; var elt;
pceltFetched: PLongint): HResult; virtual; stdcall; abstract;
function Skip(celt: Longint): HResult; virtual; stdcall; abstract;
function Reset: HResult; virtual; stdcall; abstract;
function Clone(var Enum: IEnumStatData): HResult; virtual; stdcall; abstract;
end;
{ IRootStorage interface }
IRootStorage = class(IUnknown)
public
function SwitchToFile(pszFile: POleStr): HResult; virtual; stdcall; abstract;
end;
{ IAdviseSink interface }
PRemStgMedium = ^TRemStgMedium;
tagRemSTGMEDIUM = record
tymed: Longint;
dwHandleType: Longint;
pData: Longint;
pUnkForRelease: Longint;
cbData: Longint;
data: array[0..0] of Byte;
end;
{$nonamespace tagRemSTGMEDIUM}
TRemStgMedium = tagRemSTGMEDIUM;
PStgMedium = ^TStgMedium;
tagSTGMEDIUM = record
tymed: Longint;
case Integer of
0: (hBitmap: HBitmap; unkForRelease: IUnknown);
1: (hMetaFilePict: THandle);
2: (hEnhMetaFile: THandle);
3: (hGlobal: HGlobal);
4: (lpszFileName: POleStr);
5: (stm: IStream);
6: (stg: IStorage);
end;
{$nonamespace tagSTGMEDIUM}
TStgMedium = tagSTGMEDIUM;
IAdviseSink = class(IUnknown)
public
procedure OnDataChange(var formatetc: TFormatEtc; var stgmed: TStgMedium);
virtual; stdcall; abstract;
procedure OnViewChange(dwAspect: Longint; lindex: Longint);
virtual; stdcall; abstract;
procedure OnRename(mk: IMoniker); virtual; stdcall; abstract;
procedure OnSave; virtual; stdcall; abstract;
procedure OnClose; virtual; stdcall; abstract;
end;
{ IAdviseSink2 interface }
IAdviseSink2 = class(IAdviseSink)
public
procedure OnLinkSrcChange(mk: IMoniker); virtual; stdcall; abstract;
end;
{ IDataObject interface }
IDataObject = class(IUnknown)
public
function GetData(var formatetcIn: TFormatEtc; var medium: TStgMedium):
HResult; virtual; stdcall; abstract;
function GetDataHere(var formatetc: TFormatEtc; var medium: TStgMedium):
HResult; virtual; stdcall; abstract;
function QueryGetData(var formatetc: TFormatEtc): HResult;
virtual; stdcall; abstract;
function GetCanonicalFormatEtc(var formatetc: TFormatEtc;
var formatetcOut: TFormatEtc): HResult; virtual; stdcall; abstract;
function SetData(var formatetc: TFormatEtc; var medium: TStgMedium;
fRelease: BOOL): HResult; virtual; stdcall; abstract;
function EnumFormatEtc(dwDirection: Longint; var enumFormatEtc:
IEnumFormatEtc): HResult; virtual; stdcall; abstract;
function DAdvise(var formatetc: TFormatEtc; advf: Longint;
advSink: IAdviseSink; var dwConnection: Longint): HResult; virtual; stdcall; abstract;
function DUnadvise(dwConnection: Longint): HResult; virtual; stdcall; abstract;
function EnumDAdvise(var enumAdvise: IEnumStatData): HResult;
virtual; stdcall; abstract;
end;
{ IDataAdviseHolder interface }
IDataAdviseHolder = class(IUnknown)
public
function Advise(dataObject: IDataObject; var fetc: TFormatEtc;
advf: Longint; advise: IAdviseSink; var pdwConnection: Longint): HResult;
virtual; stdcall; abstract;
function Unadvise(dwConnection: Longint): HResult; virtual; stdcall; abstract;
function EnumAdvise(var enumAdvise: IEnumStatData): HResult; virtual; stdcall; abstract;
function SendOnDataChange(dataObject: IDataObject; dwReserved: Longint;
advf: Longint): HResult; virtual; stdcall; abstract;
end;
{ IMessageFilter interface }
PInterfaceInfo = ^TInterfaceInfo;
tagINTERFACEINFO = record
unk: IUnknown;
iid: TIID;
wMethod: Word;
end;
{$nonamespace tagINTERFACEINFO}
TInterfaceInfo = tagINTERFACEINFO;
IMessageFilter = class(IUnknown)
public
function HandleInComingCall(dwCallType: Longint; htaskCaller: HTask;
dwTickCount: Longint; lpInterfaceInfo: PInterfaceInfo): Longint;
virtual; stdcall; abstract;
function RetryRejectedCall(htaskCallee: HTask; dwTickCount: Longint;
dwRejectType: Longint): Longint; virtual; stdcall; abstract;
function MessagePending(htaskCallee: HTask; dwTickCount: Longint;
dwPendingType: Longint): Longint; virtual; stdcall; abstract;
end;
{ IRpcChannelBuffer interface }
TRpcOleDataRep = Longint;
PRpcOleMessage = ^TRpcOleMessage;
tagRPCOLEMESSAGE = record
reserved1: Pointer;
dataRepresentation: TRpcOleDataRep;
Buffer: Pointer;
cbBuffer: Longint;
iMethod: Longint;
reserved2: array[0..4] of Pointer;
rpcFlags: Longint;
end;
{$nonamespace tagRPCOLEMESSAGE}
TRpcOleMessage = tagRPCOLEMESSAGE;
IRpcChannelBuffer = class(IUnknown)
public
function GetBuffer(var message: TRpcOleMessage; iid: TIID): HResult;
virtual; stdcall; abstract;
function SendReceive(var message: TRpcOleMessage;
var status: Longint): HResult; virtual; stdcall; abstract;
function FreeBuffer(var message: TRpcOleMessage): HResult;
virtual; stdcall; abstract;
function GetDestCtx(var dwDestContext: Longint;
var pvDestContext): HResult; virtual; stdcall; abstract;
function IsConnected: HResult; virtual; stdcall; abstract;
end;
{ IRpcProxyBuffer interface }
IRpcProxyBuffer = class(IUnknown)
public
function Connect(rpcChannelBuffer: IRpcChannelBuffer): HResult;
virtual; stdcall; abstract;
procedure Disconnect; virtual; stdcall; abstract;
end;
{ IRpcStubBuffer interface }
IRpcStubBuffer = class(IUnknown)
public
function Connect(unkServer: IUnknown): HResult; virtual; stdcall; abstract;
procedure Disconnect; virtual; stdcall; abstract;
function Invoke(var rpcmsg: TRpcOleMessage; rpcChannelBuffer:
IRpcChannelBuffer): HResult; virtual; stdcall; abstract;
function IsIIDSupported(const iid: TIID): IRpcStubBuffer;
virtual; stdcall; abstract;
function CountRefs: Longint; virtual; stdcall; abstract;
function DebugServerQueryInterface(var pv): HResult;
virtual; stdcall; abstract;
procedure DebugServerRelease(pv: Pointer); virtual; stdcall; abstract;
end;
{ IPSFactoryBuffer interface }
IPSFactoryBuffer = class(IUnknown)
public
function CreateProxy(unkOuter: IUnknown; const iid: TIID;
var proxy: IRpcProxyBuffer; var pv): HResult; virtual; stdcall; abstract;
function CreateStub(const iid: TIID; unkServer: IUnknown;
var stub: IRpcStubBuffer): HResult; virtual; stdcall; abstract;
end;
{ Automation types }
PBStr = ^TBStr;
TBStr = POleStr;
PBStrList = ^TBStrList;
TBStrList = array[0..65535] of TBStr;
PBlob = ^TBlob;
tagBLOB = record
cbSize: Longint;
pBlobData: Pointer;
end;
{$nonamespace tagBLOB}
TBlob = tagBLOB;
PClipData = ^TClipData;
tagCLIPDATA = record
cbSize: Longint;
ulClipFmt: Longint;
pClipData: Pointer;
end;
{$nonamespace tagCLIPDATA}
TClipData = tagCLIPDATA;
PSafeArrayBound = ^TSafeArrayBound;
tagSAFEARRAYBOUND = record
cElements: Longint;
lLbound: Longint;
end;
{$nonamespace tagSAFEARRAYBOUND}
TSafeArrayBound = tagSAFEARRAYBOUND;
PSafeArray = ^TSafeArray;
tagSAFEARRAY = record
cDims: Word;
fFeatures: Word;
cbElements: Longint;
cLocks: Longint;
pvData: Pointer;
rgsabound: array[0..0] of TSafeArrayBound;
end;
{$nonamespace tagSAFEARRAY}
TSafeArray = tagSAFEARRAY;
TOleDate = Double;
TCurrency = Comp;
TOleBool = WordBool;
TVarType = Word;
PVariantArg = ^TVariantArg;
tagVARIANT = record
vt: TVarType;
wReserved1: Word;
wReserved2: Word;
wReserved3: Word;
case Integer of
VT_UI1: (bVal: Byte);
VT_I2: (iVal: Smallint);
VT_I4: (lVal: Longint);
VT_R4: (fltVal: Single);
VT_R8: (dblVal: Double);
VT_BOOL: (vbool: TOleBool);
VT_ERROR: (scode: HResult);
VT_CY: (cyVal: TCurrency);
VT_DATE: (date: TOleDate);
VT_BSTR: (bstrVal: TBStr);
VT_UNKNOWN: (unkVal: IUnknown);
VT_DISPATCH: (dispVal: IDispatch);
VT_ARRAY: (parray: PSafeArray);
VT_BYREF or VT_UI1: (pbVal: ^Byte);
VT_BYREF or VT_I2: (piVal: ^Smallint);
VT_BYREF or VT_I4: (plVal: ^Longint);
VT_BYREF or VT_R4: (pfltVal: ^Single);
VT_BYREF or VT_R8: (pdblVal: ^Double);
VT_BYREF or VT_BOOL: (pbool: ^TOleBool);
VT_BYREF or VT_ERROR: (pscode: ^HResult);
VT_BYREF or VT_CY: (pcyVal: ^TCurrency);
VT_BYREF or VT_DATE: (pdate: ^TOleDate);
VT_BYREF or VT_BSTR: (pbstrVal: PBStr);
VT_BYREF or VT_UNKNOWN: (punkVal: ^IUnknown);
VT_BYREF or VT_DISPATCH: (pdispVal: ^IDispatch);
VT_BYREF or VT_ARRAY: (pparray: ^PSafeArray);
VT_BYREF or VT_VARIANT: (pvarVal: PVariant);
VT_BYREF: (byRef: Pointer);
end;
{$nonamespace tagVARIANT}
TVariantArg = tagVARIANT;
PVariantArgList = ^TVariantArgList;
TVariantArgList = array[0..65535] of TVariantArg;
TDispID = Longint;
PDispIDList = ^TDispIDList;
TDispIDList = array[0..65535] of TDispID;
TMemberID = Longint;
PMemberIDList = ^TMemberIDList;
TMemberIDList = array[0..65535] of TMemberID;
TPropID = Longint;
HRefType = Longint;
TTypeKind = Longint;
PArrayDesc = ^TArrayDesc;
PTypeDesc= ^TTypeDesc;
tagTYPEDESC = record
case Integer of
VT_PTR: (ptdesc: PTypeDesc; vt: TVarType);
VT_CARRAY: (padesc: PArrayDesc);
VT_USERDEFINED: (hreftype: HRefType);
end;
{$nonamespace tagTYPEDESC}
TTypeDesc = tagTYPEDESC;
tagARRAYDESC = record
tdescElem: TTypeDesc;
cDims: Word;
rgbounds: array[0..0] of TSafeArrayBound;
end;
{$nonamespace tagARRAYDESC}
TArrayDesc = tagARRAYDESC;
PIDLDesc = ^TIDLDesc;
tagIDLDESC = record
dwReserved: Longint;
wIDLFlags: Word;
end;
{$nonamespace tagIDLDESC}
TIDLDesc = tagIDLDESC;
PElemDesc = ^TElemDesc;
tagELEMDESC = record
tdesc: TTypeDesc;
idldesc: TIDLDesc;
end;
{$nonamespace tagELEMDESC}
TElemDesc = tagELEMDESC;
PElemDescList = ^TElemDescList;
TElemDescList = array[0..65535] of TElemDesc;
PTypeAttr = ^TTypeAttr;
tagTYPEATTR = record
guid: TGUID;
lcid: TLCID;
dwReserved: Longint;
memidConstructor: TMemberID;
memidDestructor: TMemberID;
lpstrSchema: POleStr;
cbSizeInstance: Longint;
typekind: TTypeKind;
cFuncs: Word;
cVars: Word;
cImplTypes: Word;
cbSizeVft: Word;
cbAlignment: Word;
wTypeFlags: Word;
wMajorVerNum: Word;
wMinorVerNum: Word;
tdescAlias: TTypeDesc;
idldescType: TIDLDesc;
end;
{$nonamespace tagTYPEATTR}
TTypeAttr = tagTYPEATTR;
PDispParams = ^TDispParams;
tagDISPPARAMS = record
rgvarg: PVariantArgList;
rgdispidNamedArgs: PDispIDList;
cArgs: Longint;
cNamedArgs: Longint;
end;
{$nonamespace tagDISPPARAMS}
TDispParams = tagDISPPARAMS;
PExcepInfo = ^TExcepInfo;
TFNDeferredFillIn = function(ExInfo: PExcepInfo): HResult stdcall;
tagEXCEPINFO = record
wCode: Word;
wReserved: Word;
bstrSource: TBStr;
bstrDescription: TBStr;
bstrHelpFile: TBStr;
dwHelpContext: Longint;
pvReserved: Pointer;
pfnDeferredFillIn: TFNDeferredFillIn;
scode: HResult;
end;
{$nonamespace tagEXCEPINFO}
TExcepInfo = tagEXCEPINFO;
TFuncKind = LongInt;
TInvokeKind = LongInt;
TCallConv = LongInt;
PFuncDesc = ^TFuncDesc;
tagFUNCDESC = record
memid: TMemberID;
lprgscode: PResultList;
lprgelemdescParam: PElemDescList;
funckind: TFuncKind;
invkind: TInvokeKind;
callconv: TCallConv;
cParams: Smallint;
cParamsOpt: Smallint;
oVft: Smallint;
cScodes: Smallint;
elemdescFunc: TElemDesc;
wFuncFlags: Word;
end;
{$nonamespace tagFUNCDESC}
TFuncDesc = tagFUNCDESC;
TVarKind = Longint;
PVarDesc = ^TVarDesc;
tagVARDESC = record
memid: TMemberID;
lpstrSchema: POleStr;
case Integer of
VAR_PERINSTANCE: (
oInst: Longint;
elemdescVar: TElemDesc;
wVarFlags: Word;
varkind: TVarKind);
VAR_CONST: (
lpvarValue: PVariant);
end;
{$nonamespace tagVARDESC}
TVarDesc = tagVARDESC;
{ ICreateTypeInfo interface }
ICreateTypeInfo = class(IUnknown)
public
function SetGuid(const guid: TGUID): HResult; virtual; stdcall; abstract;
function SetTypeFlags(uTypeFlags: Integer): HResult; virtual; stdcall; abstract;
function SetDocString(pstrDoc: POleStr): HResult; virtual; stdcall; abstract;
function SetHelpContext(dwHelpContext: Longint): HResult; virtual; stdcall; abstract;
function SetVersion(wMajorVerNum: Word; wMinorVerNum: Word): HResult;
virtual; stdcall; abstract;
function AddRefTypeInfo(tinfo: ITypeInfo; var reftype: HRefType): HResult;
virtual; stdcall; abstract;
function AddFuncDesc(index: Integer; var funcdesc: TFuncDesc): HResult;
virtual; stdcall; abstract;
function AddImplType(index: Integer; reftype: HRefType): HResult;
virtual; stdcall; abstract;
function SetImplTypeFlags(index: Integer; impltypeflags: Integer): HResult;
virtual; stdcall; abstract;
function SetAlignment(cbAlignment: Word): HResult; virtual; stdcall; abstract;
function SetSchema(lpstrSchema: POleStr): HResult; virtual; stdcall; abstract;
function AddVarDesc(index: Integer; var vardesc: TVarDesc): HResult;
virtual; stdcall; abstract;
function SetFuncAndParamNames(index: Integer; rgszNames: POleStrList;
cNames: Integer): HResult; virtual; stdcall; abstract;
function SetVarName(index: Integer; szName: POleStr): HResult; virtual; stdcall; abstract;
function SetTypeDescAlias(var descAlias: TTypeDesc): HResult; virtual; stdcall; abstract;
function DefineFuncAsDllEntry(index: Integer; szDllName: POleStr;
szProcName: POleStr): HResult; virtual; stdcall; abstract;
function SetFuncDocString(index: Integer; szDocString: POleStr): HResult;
virtual; stdcall; abstract;
function SetVarDocString(index: Integer; szDocString: POleStr): HResult;
virtual; stdcall; abstract;
function SetFuncHelpContext(index: Integer; dwHelpContext: Longint): HResult;
virtual; stdcall; abstract;
function SetVarHelpContext(index: Integer; dwHelpContext: Longint): HResult;
virtual; stdcall; abstract;
function SetMops(index: Integer; bstrMops: TBStr): HResult; virtual; stdcall; abstract;
function SetTypeIdldesc(var idldesc: TIDLDesc): HResult; virtual; stdcall; abstract;
function LayOut: HResult; virtual; stdcall; abstract;
end;
{ ICreateTypeLib interface }
ICreateTypeLib = class(IUnknown)
public
function CreateTypeInfo(szName: POleStr; tkind: TTypeKind;
var ictinfo: ICreateTypeInfo): HResult; virtual; stdcall; abstract;
function SetName(szName: POleStr): HResult; virtual; stdcall; abstract;
function SetVersion(wMajorVerNum: Word; wMinorVerNum: Word): HResult; virtual; stdcall; abstract;
function SetGuid(const guid: TGUID): HResult; virtual; stdcall; abstract;
function SetDocString(szDoc: POleStr): HResult; virtual; stdcall; abstract;
function SetHelpFileName(szHelpFileName: POleStr): HResult; virtual; stdcall; abstract;
function SetHelpContext(dwHelpContext: Longint): HResult; virtual; stdcall; abstract;
function SetLcid(lcid: TLCID): HResult; virtual; stdcall; abstract;
function SetLibFlags(uLibFlags: Integer): HResult; virtual; stdcall; abstract;
function SaveAllChanges: HResult; virtual; stdcall; abstract;
end;
{ IDispatch interface }
IDispatch = class(IUnknown)
public
function GetTypeInfoCount(var ctinfo: Integer): HResult; virtual; stdcall; abstract;
function GetTypeInfo(itinfo: Integer; lcid: TLCID; var tinfo: ITypeInfo): HResult; virtual; stdcall; abstract;
function GetIDsOfNames(const iid: TIID; rgszNames: POleStrList;
cNames: Integer; lcid: TLCID; rgdispid: PDispIDList): HResult; virtual; stdcall; abstract;
function Invoke(dispIDMember: TDispID; const iid: TIID; lcid: TLCID;
flags: Word; var dispParams: TDispParams; varResult: PVariant;
excepInfo: PExcepInfo; argErr: PInteger): HResult; virtual; stdcall; abstract;
end;
{ IEnumVariant interface }
IEnumVariant = class(IUnknown)
public
function Next(celt: Longint; var elt;
var pceltFetched: Longint): HResult; virtual; stdcall; abstract;
function Skip(celt: Longint): HResult; virtual; stdcall; abstract;
function Reset: HResult; virtual; stdcall; abstract;
function Clone(var Enum: IEnumVariant): HResult; virtual; stdcall; abstract;
end;
{ ITypeComp interface }
TDescKind = Longint;
PBindPtr = ^TBindPtr;
tagBINDPTR = record
case Integer of
0: (lpfuncdesc: PFuncDesc);
1: (lpvardesc: PVarDesc);
2: (lptcomp: ITypeComp);
end;
{$nonamespace tagBINDPTR}
TBindPtr = tagBINDPTR;
ITypeComp = class(IUnknown)
public
function Bind(szName: POleStr; lHashVal: Longint; wflags: Word;
var tinfo: ITypeInfo; var desckind: TDescKind;
var bindptr: TBindPtr): HResult; virtual; stdcall; abstract;
function BindType(szName: POleStr; lHashVal: Longint;
var tinfo: ITypeInfo; var tcomp: ITypeComp): HResult;
virtual; stdcall; abstract;
end;
{ ITypeInfo interface }
ITypeInfo = class(IUnknown)
public
function GetTypeAttr(var ptypeattr: PTypeAttr): HResult; virtual; stdcall; abstract;
function GetTypeComp(var tcomp: ITypeComp): HResult; virtual; stdcall; abstract;
function GetFuncDesc(index: Integer; var pfuncdesc: PFuncDesc): HResult;
virtual; stdcall; abstract;
function GetVarDesc(index: Integer; var pvardesc: PVarDesc): HResult;
virtual; stdcall; abstract;
function GetNames(memid: TMemberID; rgbstrNames: PBStrList;
cMaxNames: Integer; var cNames: Integer): HResult; virtual; stdcall; abstract;
function GetRefTypeOfImplType(index: Integer; var reftype: HRefType): HResult;
virtual; stdcall; abstract;
function GetImplTypeFlags(index: Integer; var impltypeflags: Integer): HResult;
virtual; stdcall; abstract;
function GetIDsOfNames(rgpszNames: POleStrList; cNames: Integer;
rgmemid: PMemberIDList): HResult; virtual; stdcall; abstract;
function Invoke(pvInstance: Pointer; memid: TMemberID; flags: Word;
var dispParams: TDispParams; varResult: PVariant;
excepInfo: PExcepInfo; argErr: PInteger): HResult; virtual; stdcall; abstract;
function GetDocumentation(memid: TMemberID; pbstrName: PBStr;
pbstrDocString: PBStr; pdwHelpContext: PLongint;
pbstrHelpFile: PBStr): HResult; virtual; stdcall; abstract;
function GetDllEntry(memid: TMemberID; invkind: TInvokeKind;
var bstrDllName: TBStr; var bstrName: TBStr; var wOrdinal: Word): HResult;
virtual; stdcall; abstract;
function GetRefTypeInfo(reftype: HRefType; var tinfo: ITypeInfo): HResult;
virtual; stdcall; abstract;
function AddressOfMember(memid: TMemberID; invkind: TInvokeKind;
var ppv: Pointer): HResult; virtual; stdcall; abstract;
function CreateInstance(unkOuter: IUnknown; const iid: TIID;
var vObj): HResult; virtual; stdcall; abstract;
function GetMops(memid: TMemberID; var bstrMops: TBStr): HResult;
virtual; stdcall; abstract;
function GetContainingTypeLib(var tlib: ITypeLib; var pindex: Integer): HResult;
virtual; stdcall; abstract;
procedure ReleaseTypeAttr(ptypeattr: PTypeAttr); virtual; stdcall; abstract;
procedure ReleaseFuncDesc(pfuncdesc: PFuncDesc); virtual; stdcall; abstract;
procedure ReleaseVarDesc(pvardesc: PVarDesc); virtual; stdcall; abstract;
end;
{ ITypeLib interface }
TSysKind = Longint;
PTLibAttr = ^TTLibAttr;
tagTLIBATTR = record
guid: TGUID;
lcid: TLCID;
syskind: TSysKind;
wMajorVerNum: Word;
wMinorVerNum: Word;
wLibFlags: Word;
end;
{$nonamespace tagTLIBATTR}
TTLibAttr = tagTLIBATTR;
PTypeInfoList = ^TTypeInfoList;
TTypeInfoList = array[0..65535] of ITypeInfo;
ITypeLib = class(IUnknown)
public
function GetTypeInfoCount: Integer; virtual; stdcall; abstract;
function GetTypeInfo(index: Integer; var tinfo: ITypeInfo): HResult; virtual; stdcall; abstract;
function GetTypeInfoType(index: Integer; var tkind: TTypeKind): HResult;
virtual; stdcall; abstract;
function GetTypeInfoOfGuid(const guid: TGUID; var tinfo: ITypeInfo): HResult;
virtual; stdcall; abstract;
function GetLibAttr(var ptlibattr: PTLibAttr): HResult; virtual; stdcall; abstract;
function GetTypeComp(var tcomp: ITypeComp): HResult; virtual; stdcall; abstract;
function GetDocumentation(index: Integer; pbstrName: PBStr;
pbstrDocString: PBStr; pdwHelpContext: PLongint;
pbstrHelpFile: PBStr): HResult; virtual; stdcall; abstract;
function IsName(szNameBuf: POleStr; lHashVal: Longint; var fName: BOOL): HResult;
virtual; stdcall; abstract;
function FindName(szNameBuf: POleStr; lHashVal: Longint;
rgptinfo: PTypeInfoList; rgmemid: PMemberIDList;
var pcFound: Word): HResult; virtual; stdcall; abstract;
procedure ReleaseTLibAttr(ptlibattr: PTLibAttr); virtual; stdcall; abstract;
end;
{ IErrorInfo interface }
IErrorInfo = class(IUnknown)
public
function GetGUID(var guid: TGUID): HResult; virtual; stdcall; abstract;
function GetSource(var bstrSource: TBStr): HResult; virtual; stdcall; abstract;
function GetDescription(var bstrDescription: TBStr): HResult; virtual; stdcall; abstract;
function GetHelpFile(var bstrHelpFile: TBStr): HResult; virtual; stdcall; abstract;
function GetHelpContext(var dwHelpContext: Longint): HResult; virtual; stdcall; abstract;
end;
{ ICreateErrorInfo interface }
ICreateErrorInfo = class(IUnknown)
public
function SetGUID(const guid: TGUID): HResult; virtual; stdcall; abstract;
function SetSource(szSource: POleStr): HResult; virtual; stdcall; abstract;
function SetDescription(szDescription: POleStr): HResult; virtual; stdcall; abstract;
function SetHelpFile(szHelpFile: POleStr): HResult; virtual; stdcall; abstract;
function SetHelpContext(dwHelpContext: Longint): HResult; virtual; stdcall; abstract;
end;
{ ISupportErrorInfo interface }
ISupportErrorInfo = class(IUnknown)
public
function InterfaceSupportsErrorInfo(const iid: TIID): HResult; virtual; stdcall; abstract;
end;
{ IDispatch implementation support }
PParamData = ^TParamData;
tagPARAMDATA = record
szName: POleStr;
vt: TVarType;
end;
{$nonamespace tagPARAMDATA}
TParamData = tagPARAMDATA;
PParamDataList = ^TParamDataList;
TParamDataList = array[0..65535] of TParamData;
PMethodData = ^TMethodData;
tagMETHODDATA = record
szName: POleStr;
ppdata: PParamDataList;
dispid: TDispID;
iMeth: Integer;
cc: TCallConv;
cArgs: Integer;
wFlags: Word;
vtReturn: TVarType;
end;
{$nonamespace tagMETHODDATA}
TMethodData = tagMETHODDATA;
PMethodDataList = ^TMethodDataList;
TMethodDataList = array[0..65535] of TMethodData;
PInterfaceData = ^TInterfaceData;
tagINTERFACEDATA = record
pmethdata: PMethodDataList;
cMembers: Integer;
end;
{$nonamespace tagINTERFACEDATA}
TInterfaceData = tagINTERFACEDATA;
{ IOleAdviseHolder interface }
IOleAdviseHolder = class(IUnknown)
public
function Advise(advise: IAdviseSink; var dwConnection: Longint): HResult;
virtual; stdcall; abstract;
function Unadvise(dwConnection: Longint): HResult; virtual; stdcall; abstract;
function EnumAdvise(var enumAdvise: IEnumStatData): HResult; virtual; stdcall; abstract;
function SendOnRename(mk: IMoniker): HResult; virtual; stdcall; abstract;
function SendOnSave: HResult; virtual; stdcall; abstract;
function SendOnClose: HResult; virtual; stdcall; abstract;
end;
{ IOleCache interface }
IOleCache = class(IUnknown)
public
function Cache(var formatetc: TFormatEtc; advf: Longint;
var dwConnection: Longint): HResult; virtual; stdcall; abstract;
function Uncache(dwConnection: Longint): HResult; virtual; stdcall; abstract;
function EnumCache(var enumStatData: IEnumStatData): HResult;
virtual; stdcall; abstract;
function InitCache(dataObject: IDataObject): HResult; virtual; stdcall; abstract;
function SetData(var formatetc: TFormatEtc; var medium: TStgMedium;
fRelease: BOOL): HResult; virtual; stdcall; abstract;
end;
{ IOleCache2 interface }
IOleCache2 = class(IOleCache)
public
function UpdateCache(dataObject: IDataObject; grfUpdf: Longint;
pReserved: Pointer): HResult; virtual; stdcall; abstract;
function DiscardCache(dwDiscardOptions: Longint): HResult; virtual; stdcall; abstract;
end;
{ IOleCacheControl interface }
IOleCacheControl = class(IUnknown)
public
function OnRun(dataObject: IDataObject): HResult; virtual; stdcall; abstract;
function OnStop: HResult; virtual; stdcall; abstract;
end;
{ IParseDisplayName interface }
IParseDisplayName = class(IUnknown)
public
function ParseDisplayName(bc: IBindCtx; pszDisplayName: POleStr;
var chEaten: Longint; var mkOut: IMoniker): HResult; virtual; stdcall; abstract;
end;
{ IOleContainer interface }
IOleContainer = class(IParseDisplayName)
public
function EnumObjects(grfFlags: Longint; var Enum: IEnumUnknown): HResult;
virtual; stdcall; abstract;
function LockContainer(fLock: BOOL): HResult; virtual; stdcall; abstract;
end;
{ IOleClientSite interface }
IOleClientSite = class(IUnknown)
public
function SaveObject: HResult; virtual; stdcall; abstract;
function GetMoniker(dwAssign: Longint; dwWhichMoniker: Longint;
var mk: IMoniker): HResult; virtual; stdcall; abstract;
function GetContainer(var container: IOleContainer): HResult; virtual; stdcall; abstract;
function ShowObject: HResult; virtual; stdcall; abstract;
function OnShowWindow(fShow: BOOL): HResult; virtual; stdcall; abstract;
function RequestNewObjectLayout: HResult; virtual; stdcall; abstract;
end;
{ IOleObject interface }
IOleObject = class(IUnknown)
public
function SetClientSite(clientSite: IOleClientSite): HResult;
virtual; stdcall; abstract;
function GetClientSite(var clientSite: IOleClientSite): HResult;
virtual; stdcall; abstract;
function SetHostNames(szContainerApp: POleStr;
szContainerObj: POleStr): HResult; virtual; stdcall; abstract;
function Close(dwSaveOption: Longint): HResult; virtual; stdcall; abstract;
function SetMoniker(dwWhichMoniker: Longint; mk: IMoniker): HResult;
virtual; stdcall; abstract;
function GetMoniker(dwAssign: Longint; dwWhichMoniker: Longint;
var mk: IMoniker): HResult; virtual; stdcall; abstract;
function InitFromData(dataObject: IDataObject; fCreation: BOOL;
dwReserved: Longint): HResult; virtual; stdcall; abstract;
function GetClipboardData(dwReserved: Longint;
var dataObject: IDataObject): HResult; virtual; stdcall; abstract;
function DoVerb(iVerb: Longint; msg: PMsg; activeSite: IOleClientSite;
lindex: Longint; hwndParent: HWND; const posRect: TRect): HResult;
virtual; stdcall; abstract;
function EnumVerbs(var enumOleVerb: IEnumOleVerb): HResult; virtual; stdcall; abstract;
function Update: HResult; virtual; stdcall; abstract;
function IsUpToDate: HResult; virtual; stdcall; abstract;
function GetUserClassID(var clsid: TCLSID): HResult; virtual; stdcall; abstract;
function GetUserType(dwFormOfType: Longint; var pszUserType: POleStr): HResult;
virtual; stdcall; abstract;
function SetExtent(dwDrawAspect: Longint; const size: TPoint): HResult;
virtual; stdcall; abstract;
function GetExtent(dwDrawAspect: Longint; var size: TPoint): HResult;
virtual; stdcall; abstract;
function Advise(advSink: IAdviseSink; var dwConnection: Longint): HResult;
virtual; stdcall; abstract;
function Unadvise(dwConnection: Longint): HResult; virtual; stdcall; abstract;
function EnumAdvise(var enumAdvise: IEnumStatData): HResult; virtual; stdcall; abstract;
function GetMiscStatus(dwAspect: Longint; var dwStatus: Longint): HResult;
virtual; stdcall; abstract;
function SetColorScheme(var logpal: TLogPalette): HResult; virtual; stdcall; abstract;
end;
{ OLE types }
PObjectDescriptor = ^TObjectDescriptor;
tagOBJECTDESCRIPTOR = record
cbSize: Longint;
clsid: TCLSID;
dwDrawAspect: Longint;
size: TPoint;
point: TPoint;
dwStatus: Longint;
dwFullUserTypeName: Longint;
dwSrcOfCopy: Longint;
end;
{$nonamespace tagOBJECTDESCRIPTOR}
TObjectDescriptor = tagOBJECTDESCRIPTOR;
PLinkSrcDescriptor = PObjectDescriptor;
TLinkSrcDescriptor = TObjectDescriptor;
{ IOleWindow interface }
IOleWindow = class(IUnknown)
public
function GetWindow(var wnd: HWnd): HResult; virtual; stdcall; abstract;
function ContextSensitiveHelp(fEnterMode: BOOL): HResult; virtual; stdcall; abstract;
end;
{ IOleLink interface }
IOleLink = class(IUnknown)
public
function SetUpdateOptions(dwUpdateOpt: Longint): HResult;
virtual; stdcall; abstract;
function GetUpdateOptions(var dwUpdateOpt: Longint): HResult; virtual; stdcall; abstract;
function SetSourceMoniker(mk: IMoniker; const clsid: TCLSID): HResult;
virtual; stdcall; abstract;
function GetSourceMoniker(var mk: IMoniker): HResult; virtual; stdcall; abstract;
function SetSourceDisplayName(pszDisplayName: POleStr): HResult;
virtual; stdcall; abstract;
function GetSourceDisplayName(var pszDisplayName: POleStr): HResult;
virtual; stdcall; abstract;
function BindToSource(bindflags: Longint; bc: IBindCtx): HResult;
virtual; stdcall; abstract;
function BindIfRunning: HResult; virtual; stdcall; abstract;
function GetBoundSource(var unk: IUnknown): HResult; virtual; stdcall; abstract;
function UnbindSource: HResult; virtual; stdcall; abstract;
function Update(bc: IBindCtx): HResult; virtual; stdcall; abstract;
end;
{ IOleItemContainer interface }
IOleItemContainer = class(IOleContainer)
public
function GetObject(pszItem: POleStr; dwSpeedNeeded: Longint;
bc: IBindCtx; const iid: TIID; var vObject): HResult; virtual; stdcall; abstract;
function GetObjectStorage(pszItem: POleStr; bc: IBindCtx;
const iid: TIID; var vStorage): HResult; virtual; stdcall; abstract;
function IsRunning(pszItem: POleStr): HResult; virtual; stdcall; abstract;
end;
{ IOleInPlaceUIWindow interface }
IOleInPlaceUIWindow = class(IOleWindow)
public
function GetBorder(var rectBorder: TRect): HResult; virtual; stdcall; abstract;
function RequestBorderSpace(const borderwidths: TRect): HResult; virtual; stdcall; abstract;
function SetBorderSpace(pborderwidths: PRect): HResult; virtual; stdcall; abstract;
function SetActiveObject(activeObject: IOleInPlaceActiveObject;
pszObjName: POleStr): HResult; virtual; stdcall; abstract;
end;
{ IOleInPlaceActiveObject interface }
IOleInPlaceActiveObject = class(IOleWindow)
public
function TranslateAccelerator(var msg: TMsg): HResult; virtual; stdcall; abstract;
function OnFrameWindowActivate(fActivate: BOOL): HResult; virtual; stdcall; abstract;
function OnDocWindowActivate(fActivate: BOOL): HResult; virtual; stdcall; abstract;
function ResizeBorder(const rcBorder: TRect; uiWindow: IOleInPlaceUIWindow;
fFrameWindow: BOOL): HResult; virtual; stdcall; abstract;
function EnableModeless(fEnable: BOOL): HResult; virtual; stdcall; abstract;
end;
{ IOleInPlaceFrame interface }
POleInPlaceFrameInfo = ^TOleInPlaceFrameInfo;
tagOIFI = record
cb: Integer;
fMDIApp: BOOL;
hwndFrame: HWND;
haccel: HAccel;
cAccelEntries: Integer;
end;
{$nonamespace tagOIFI}
TOleInPlaceFrameInfo = tagOIFI;
POleMenuGroupWidths = ^TOleMenuGroupWidths;
tagOleMenuGroupWidths = record
width: array[0..5] of Longint;
end;
{$nonamespace tagOleMenuGroupWidths}
TOleMenuGroupWidths = tagOleMenuGroupWidths;
IOleInPlaceFrame = class(IOleInPlaceUIWindow)
public
function InsertMenus(hmenuShared: HMenu;
var menuWidths: TOleMenuGroupWidths): HResult; virtual; stdcall; abstract;
function SetMenu(hmenuShared: HMenu; holemenu: HMenu;
hwndActiveObject: HWnd): HResult; virtual; stdcall; abstract;
function RemoveMenus(hmenuShared: HMenu): HResult; virtual; stdcall; abstract;
function SetStatusText(pszStatusText: POleStr): HResult; virtual; stdcall; abstract;
function EnableModeless(fEnable: BOOL): HResult; virtual; stdcall; abstract;
function TranslateAccelerator(var msg: TMsg; wID: Word): HResult; virtual; stdcall; abstract;
end;
{ IOleInPlaceObject interface }
IOleInPlaceObject = class(IOleWindow)
public
function InPlaceDeactivate: HResult; virtual; stdcall; abstract;
function UIDeactivate: HResult; virtual; stdcall; abstract;
function SetObjectRects(const rcPosRect: TRect;
const rcClipRect: TRect): HResult; virtual; stdcall; abstract;
function ReactivateAndUndo: HResult; virtual; stdcall; abstract;
end;
{ IOleInPlaceSite interface }
IOleInPlaceSite = class(IOleWindow)
public
function CanInPlaceActivate: HResult; virtual; stdcall; abstract;
function OnInPlaceActivate: HResult; virtual; stdcall; abstract;
function OnUIActivate: HResult; virtual; stdcall; abstract;
function GetWindowContext(var frame: IOleInPlaceFrame;
var doc: IOleInPlaceUIWindow; var rcPosRect: TRect;
var rcClipRect: TRect; var frameInfo: TOleInPlaceFrameInfo): HResult;
virtual; stdcall; abstract;
function Scroll(const scrollExtent: TPoint): HResult; virtual; stdcall; abstract;
function OnUIDeactivate(fUndoable: BOOL): HResult; virtual; stdcall; abstract;
function OnInPlaceDeactivate: HResult; virtual; stdcall; abstract;
function DiscardUndoState: HResult; virtual; stdcall; abstract;
function DeactivateAndUndo: HResult; virtual; stdcall; abstract;
function OnPosRectChange(const rcPosRect: TRect): HResult; virtual; stdcall; abstract;
end;
{ IViewObject interface }
TContinueFunc = function(dwContinue: Longint): BOOL stdcall;
IViewObject = class(IUnknown)
public
function Draw(dwDrawAspect: Longint; lindex: Longint; pvAspect: Pointer;
ptd: PDVTargetDevice; hicTargetDev: HDC; hdcDraw: HDC;
prcBounds: PRect; prcWBounds: PRect; fnContinue: TContinueFunc;
dwContinue: Longint): HResult; virtual; stdcall; abstract;
function GetColorSet(dwDrawAspect: Longint; lindex: Longint;
pvAspect: Pointer; ptd: PDVTargetDevice; hicTargetDev: HDC;
var colorSet: PLogPalette): HResult; virtual; stdcall; abstract;
function Freeze(dwDrawAspect: Longint; lindex: Longint; pvAspect: Pointer;
var dwFreeze: Longint): HResult; virtual; stdcall; abstract;
function Unfreeze(dwFreeze: Longint): HResult; virtual; stdcall; abstract;
function SetAdvise(aspects: Longint; advf: Longint;
advSink: IAdviseSink): HResult; virtual; stdcall; abstract;
function GetAdvise(pAspects: PLongint; pAdvf: PLongint;
var advSink: IAdviseSink): HResult; virtual; stdcall; abstract;
end;
{ IViewObject2 interface }
IViewObject2 = class(IViewObject)
public
function GetExtent(dwDrawAspect: Longint; lindex: Longint;
ptd: PDVTargetDevice; var size: TPoint): HResult; virtual; stdcall; abstract;
end;
{ IDropSource interface }
IDropSource = class(IUnknown)
public
function QueryContinueDrag(fEscapePressed: BOOL;
grfKeyState: Longint): HResult; virtual; stdcall; abstract;
function GiveFeedback(dwEffect: Longint): HResult; virtual; stdcall; abstract;
end;
{ IDropTarget interface }
IDropTarget = class(IUnknown)
public
function DragEnter(dataObj: IDataObject; grfKeyState: Longint;
const pt: TPoint; var dwEffect: Longint): HResult; virtual; stdcall; abstract;
function DragOver(grfKeyState: Longint; const pt: TPoint;
var dwEffect: Longint): HResult; virtual; stdcall; abstract;
function DragLeave: HResult; virtual; stdcall; abstract;
function Drop(dataObj: IDataObject; grfKeyState: Longint; const pt: TPoint;
var dwEffect: Longint): HResult; virtual; stdcall; abstract;
end;
{ IEnumOleVerb interface }
POleVerb = ^TOleVerb;
tagOLEVERB = record
lVerb: Longint;
lpszVerbName: POleStr;
fuFlags: Longint;
grfAttribs: Longint;
end;
{$nonamespace tagOLEVERB}
TOleVerb = tagOLEVERB;
IEnumOleVerb = class(IUnknown)
public
function Next(celt: Longint; var elt;
pceltFetched: PLongint): HResult; virtual; stdcall; abstract;
function Skip(celt: Longint): HResult; virtual; stdcall; abstract;
function Reset: HResult; virtual; stdcall; abstract;
function Clone(var enm: IEnumOleVerb): HResult; virtual; stdcall; abstract;
end;
const
{ Standard GUIDs }
GUID_NULL: TGUID = (
D1:$00000000;D2:$0000;D3:$0000;D4:($00,$00,$00,$00,$00,$00,$00,$00));
IID_IUnknown: TGUID = (
D1:$00000000;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IClassFactory: TGUID = (
D1:$00000001;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IMarshal: TGUID = (
D1:$00000003;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IMalloc: TGUID = (
D1:$00000002;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IStdMarshalInfo: TGUID = (
D1:$00000018;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IExternalConnection: TGUID = (
D1:$00000019;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IEnumUnknown: TGUID = (
D1:$00000100;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IBindCtx: TGUID = (
D1:$0000000E;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IEnumMoniker: TGUID = (
D1:$00000102;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IRunnableObject: TGUID = (
D1:$00000126;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IRunningObjectTable: TGUID = (
D1:$00000010;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IPersist: TGUID = (
D1:$0000010C;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IPersistStream: TGUID = (
D1:$00000109;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IMoniker: TGUID = (
D1:$0000000F;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IEnumString: TGUID = (
D1:$00000101;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IStream: TGUID = (
D1:$0000000C;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IEnumStatStg: TGUID = (
D1:$0000000D;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IStorage: TGUID = (
D1:$0000000B;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IPersistFile: TGUID = (
D1:$0000010B;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IPersistStorage: TGUID = (
D1:$0000010A;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_ILockBytes: TGUID = (
D1:$0000000A;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IEnumFormatEtc: TGUID = (
D1:$00000103;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IEnumStatData: TGUID = (
D1:$00000105;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IRootStorage: TGUID = (
D1:$00000012;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IAdviseSink: TGUID = (
D1:$0000010F;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IAdviseSink2: TGUID = (
D1:$00000125;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IDataObject: TGUID = (
D1:$0000010E;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IDataAdviseHolder: TGUID = (
D1:$00000110;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IMessageFilter: TGUID = (
D1:$00000016;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IRpcChannelBuffer: TGUID = (
D1:$D5F56B60;D2:$593B;D3:$101A;D4:($B5,$69,$08,$00,$2B,$2D,$BF,$7A));
IID_IRpcProxyBuffer: TGUID = (
D1:$D5F56A34;D2:$593B;D3:$101A;D4:($B5,$69,$08,$00,$2B,$2D,$BF,$7A));
IID_IRpcStubBuffer: TGUID = (
D1:$D5F56AFC;D2:$593B;D3:$101A;D4:($B5,$69,$08,$00,$2B,$2D,$BF,$7A));
IID_IPSFactoryBuffer: TGUID = (
D1:$D5F569D0;D2:$593B;D3:$101A;D4:($B5,$69,$08,$00,$2B,$2D,$BF,$7A));
IID_ICreateTypeInfo: TGUID = (
D1:$00020405;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_ICreateTypeLib: TGUID = (
D1:$00020406;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IDispatch: TGUID = (
D1:$00020400;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IEnumVariant: TGUID = (
D1:$00020404;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_ITypeComp: TGUID = (
D1:$00020403;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_ITypeInfo: TGUID = (
D1:$00020401;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_ITypeLib: TGUID = (
D1:$00020402;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IErrorInfo: TGUID = (
D1:$1CF2B120;D2:$547D;D3:$101B;D4:($8E,$65,$08,$00,$2B,$2B,$D1,$19));
IID_ICreateErrorInfo: TGUID = (
D1:$22F03340;D2:$547D;D3:$101B;D4:($8E,$65,$08,$00,$2B,$2B,$D1,$19));
IID_ISupportErrorInfo: TGUID = (
D1:$DF0B3D60;D2:$548F;D3:$101B;D4:($8E,$65,$08,$00,$2B,$2B,$D1,$19));
IID_IOleAdviseHolder: TGUID = (
D1:$00000111;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleCache: TGUID = (
D1:$0000011E;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleCache2: TGUID = (
D1:$00000128;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleCacheControl: TGUID = (
D1:$00000129;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IParseDisplayName: TGUID = (
D1:$0000011A;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleContainer: TGUID = (
D1:$0000011B;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleClientSite: TGUID = (
D1:$00000118;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleObject: TGUID = (
D1:$00000112;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleWindow: TGUID = (
D1:$00000114;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleLink: TGUID = (
D1:$0000011D;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleItemContainer: TGUID = (
D1:$0000011C;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleInPlaceUIWindow: TGUID = (
D1:$00000115;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleInPlaceActiveObject: TGUID = (
D1:$00000117;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleInPlaceFrame: TGUID = (
D1:$00000116;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleInPlaceObject: TGUID = (
D1:$00000113;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleInPlaceSite: TGUID = (
D1:$00000119;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IViewObject: TGUID = (
D1:$0000010D;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IViewObject2: TGUID = (
D1:$00000127;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IDropSource: TGUID = (
D1:$00000121;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IDropTarget: TGUID = (
D1:$00000122;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IEnumOleVerb: TGUID = (
D1:$00000104;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
{ Additional GUIDs }
IID_IRpcChannel: TGUID = (
D1:$00000004;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IRpcStub: TGUID = (
D1:$00000005;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IStubManager: TGUID = (
D1:$00000006;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IRpcProxy: TGUID = (
D1:$00000007;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IProxyManager: TGUID = (
D1:$00000008;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IPSFactory: TGUID = (
D1:$00000009;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IInternalMoniker: TGUID = (
D1:$00000011;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
CLSID_StdMarshal: TGUID = (
D1:$00000017;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IEnumGeneric: TGUID = (
D1:$00000106;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IEnumHolder: TGUID = (
D1:$00000107;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IEnumCallback: TGUID = (
D1:$00000108;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOleManager: TGUID = (
D1:$0000011F;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IOlePresObj: TGUID = (
D1:$00000120;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IDebug: TGUID = (
D1:$00000123;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
IID_IDebugStream: TGUID = (
D1:$00000124;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
{ HResult manipulation routines }
function Succeeded(Res: HResult): Boolean;
function Failed(Res: HResult): Boolean;
function ResultCode(Res: HResult): Integer;
function ResultFacility(Res: HResult): Integer;
function ResultSeverity(Res: HResult): Integer;
function MakeResult(Severity, Facility, Code: Integer): HResult;
{ GUID functions }
function IsEqualGUID(const guid1, guid2: TGUID): Boolean; stdcall;
function IsEqualIID(const iid1, iid2: TIID): Boolean; stdcall;
function IsEqualCLSID(const clsid1, clsid2: TCLSID): Boolean; stdcall;
{ Standard object API functions }
function CoBuildVersion: Longint; stdcall;
{ Init/Uninit }
function CoInitialize(pvReserved: Pointer): HResult; stdcall;
procedure CoUninitialize; stdcall;
function CoGetMalloc(dwMemContext: Longint; var malloc: IMalloc): HResult; stdcall;
function CoGetCurrentProcess: Longint; stdcall;
function CoRegisterMallocSpy(mallocSpy: IMallocSpy): HResult; stdcall;
function CoRevokeMallocSpy: HResult stdcall;
function CoCreateStandardMalloc(memctx: Longint; var malloc: IMalloc): HResult; stdcall;
{ Register, revoke, and get class objects }
function CoGetClassObject(const clsid: TCLSID; dwClsContext: Longint;
pvReserved: Pointer; const iid: TIID; var pv): HResult; stdcall;
function CoRegisterClassObject(const clsid: TCLSID; unk: IUnknown;
dwClsContext: Longint; flags: Longint; var dwRegister: Longint): HResult; stdcall;
function CoRevokeClassObject(dwRegister: Longint): HResult; stdcall;
{ Marshaling interface pointers }
function CoGetMarshalSizeMax(var ulSize: Longint; const iid: TIID;
unk: IUnknown; dwDestContext: Longint; pvDestContext: Pointer;
mshlflags: Longint): HResult; stdcall;
function CoMarshalInterface(stm: IStream; const iid: TIID; unk: IUnknown;
dwDestContext: Longint; pvDestContext: Pointer;
mshlflags: Longint): HResult; stdcall;
function CoUnmarshalInterface(stm: IStream; const iid: TIID;
var pv): HResult; stdcall;
function CoMarshalHResult(stm: IStream; result: HResult): HResult; stdcall;
function CoUnmarshalHResult(stm: IStream; var result: HResult): HResult; stdcall;
function CoReleaseMarshalData(stm: IStream): HResult; stdcall;
function CoDisconnectObject(unk: IUnknown; dwReserved: Longint): HResult; stdcall;
function CoLockObjectExternal(unk: IUnknown; fLock: BOOL;
fLastUnlockReleases: BOOL): HResult; stdcall;
function CoGetStandardMarshal(const iid: TIID; unk: IUnknown;
dwDestContext: Longint; pvDestContext: Pointer; mshlflags: Longint;
var marshal: IMarshal): HResult; stdcall;
function CoIsHandlerConnected(unk: IUnknown): BOOL; stdcall;
function CoHasStrongExternalConnections(unk: IUnknown): BOOL; stdcall;
{ Apartment model inter-thread interface passing helpers }
function CoMarshalInterThreadInterfaceInStream(const iid: TIID;
unk: IUnknown; var stm: IStream): HResult; stdcall;
function CoGetInterfaceAndReleaseStream(stm: IStream; const iid: TIID;
var pv): HResult; stdcall;
function CoCreateFreeThreadedMarshaler(unkOuter: IUnknown;
var unkMarshal: IUnknown): HResult; stdcall;
{ DLL loading helpers; keeps track of ref counts and unloads all on exit }
function CoLoadLibrary(pszLibName: POleStr; bAutoFree: BOOL): THandle; stdcall;
procedure CoFreeLibrary(hInst: THandle); stdcall;
procedure CoFreeAllLibraries; stdcall;
procedure CoFreeUnusedLibraries; stdcall;
{ Helper for creating instances }
function CoCreateInstance(const clsid: TCLSID; unkOuter: IUnknown;
dwClsContext: Longint; const iid: TIID; var pv): HResult; stdcall;
{ Other helpers }
function StringFromCLSID(const clsid: TCLSID; var psz: POleStr): HResult; stdcall;
function CLSIDFromString(psz: POleStr; var clsid: TCLSID): HResult; stdcall;
function StringFromIID(const iid: TIID; var psz: POleStr): HResult; stdcall;
function IIDFromString(psz: POleStr; var iid: TIID): HResult; stdcall;
function CoIsOle1Class(const clsid: TCLSID): BOOL; stdcall;
function ProgIDFromCLSID(const clsid: TCLSID; var pszProgID: POleStr): HResult; stdcall;
function CLSIDFromProgID(pszProgID: POleStr; var clsid: TCLSID): HResult; stdcall;
function StringFromGUID2(const guid: TGUID; psz: POleStr; cbMax: Integer): Integer; stdcall;
function CoCreateGuid(var guid: TGUID): HResult; stdcall;
function CoFileTimeToDosDateTime(var filetime: TFileTime; var dosDate: Word;
var dosTime: Word): BOOL; stdcall;
function CoDosDateTimeToFileTime(nDosDate: Word; nDosTime: Word;
var filetime: TFileTime): BOOL; stdcall;
function CoFileTimeNow(var filetime: TFileTime): HResult; stdcall;
function CoRegisterMessageFilter(messageFilter: IMessageFilter;
var pMessageFilter: IMessageFilter): HResult; stdcall;
{ TreatAs APIs }
function CoGetTreatAsClass(const clsidOld: TCLSID; var clsidNew: TCLSID): HResult; stdcall;
function CoTreatAsClass(const clsidOld: TCLSID; const clsidNew: TCLSID): HResult; stdcall;
{ The server DLLs must define their DllGetClassObject and DllCanUnloadNow
to match these; the typedefs are located here to ensure all are changed at
the same time }
type
TDLLGetClassObject = function(const clsid: TCLSID; const iid: TIID;
var pv): HResult stdcall;
TDLLCanUnloadNow = function: HResult stdcall;
{ Default memory allocation }
function CoTaskMemAlloc(cb: Longint): Pointer; stdcall;
function CoTaskMemRealloc(pv: Pointer; cb: Longint): Pointer; stdcall;
procedure CoTaskMemFree(pv: Pointer); stdcall;
{ DV APIs }
function CreateDataAdviseHolder(var DAHolder: IDataAdviseHolder): HResult; stdcall;
function CreateDataCache(unkOuter: IUnknown; const clsid: TCLSID;
const iid: TIID; var pv): HResult; stdcall;
{ Storage API prototypes }
function StgCreateDocfile(pwcsName: POleStr; grfMode: Longint;
reserved: Longint; var stgOpen: IStorage): HResult; stdcall;
function StgCreateDocfileOnILockBytes(lkbyt: ILockBytes; grfMode: Longint;
reserved: Longint; var stgOpen: IStorage): HResult; stdcall;
function StgOpenStorage(pwcsName: POleStr; stgPriority: IStorage;
grfMode: Longint; snbExclude: TSNB; reserved: Longint;
var stgOpen: IStorage): HResult; stdcall;
function StgOpenStorageOnILockBytes(lkbyt: ILockBytes; stgPriority: IStorage;
grfMode: Longint; snbExclude: TSNB; reserved: Longint;
var stgOpen: IStorage): HResult; stdcall;
function StgIsStorageFile(pwcsName: POleStr): HResult; stdcall;
function StgIsStorageILockBytes(lkbyt: ILockBytes): HResult; stdcall;
function StgSetTimes(pszName: POleStr; const ctime: TFileTime;
const atime: TFileTime; const mtime: TFileTime): HResult; stdcall;
{ Moniker APIs }
function BindMoniker(mk: IMoniker; grfOpt: Longint; const iidResult: TIID;
var pvResult): HResult; stdcall;
function MkParseDisplayName(bc: IBindCtx; szUserName: POleStr;
var chEaten: Longint; var mk: IMoniker): HResult; stdcall;
function MonikerRelativePathTo(mkSrc: IMoniker; mkDest: IMoniker;
var mkRelPath: IMoniker; dwReserved: BOOL): HResult; stdcall;
function MonikerCommonPrefixWith(mkThis: IMoniker; mkOther: IMoniker;
var mkCommon: IMoniker): HResult; stdcall;
function CreateBindCtx(reserved: Longint; var bc: IBindCtx): HResult; stdcall;
function CreateGenericComposite(mkFirst: IMoniker; mkRest: IMoniker;
var mkComposite: IMoniker): HResult; stdcall;
function GetClassFile(szFilename: POleStr; var clsid: TCLSID): HResult; stdcall;
function CreateFileMoniker(pszPathName: POleStr; var mk: IMoniker): HResult; stdcall;
function CreateItemMoniker(pszDelim: POleStr; pszItem: POleStr;
var mk: IMoniker): HResult; stdcall;
function CreateAntiMoniker(var mk: IMoniker): HResult; stdcall;
function CreatePointerMoniker(unk: IUnknown; var mk: IMoniker): HResult; stdcall;
function GetRunningObjectTable(reserved: Longint;
var rot: IRunningObjectTable): HResult; stdcall;
{ TBStr API }
function SysAllocString(psz: POleStr): TBStr; stdcall;
function SysReAllocString(var bstr: TBStr; psz: POleStr): Integer; stdcall;
function SysAllocStringLen(psz: POleStr; len: Integer): TBStr; stdcall;
function SysReAllocStringLen(var bstr: TBStr; psz: POleStr;
len: Integer): Integer; stdcall;
procedure SysFreeString(bstr: TBStr); stdcall;
function SysStringLen(bstr: TBStr): Integer; stdcall;
function SysStringByteLen(bstr: TBStr): Integer; stdcall;
function SysAllocStringByteLen(psz: PChar; len: Integer): TBStr; stdcall;
{ Time API }
function DosDateTimeToVariantTime(wDosDate, wDosTime: Word;
var vtime: TOleDate): Integer; stdcall;
function VariantTimeToDosDateTime(vtime: TOleDate; var wDosDate,
wDosTime: Word): Integer; stdcall;
{ SafeArray API }
function SafeArrayAllocDescriptor(cDims: Integer; var psaOut: PSafeArray): HResult; stdcall;
function SafeArrayAllocData(psa: PSafeArray): HResult; stdcall;
function SafeArrayCreate(vt: TVarType; cDims: Integer; const rgsabound): PSafeArray; stdcall;
function SafeArrayDestroyDescriptor(psa: PSafeArray): HResult; stdcall;
function SafeArrayDestroyData(psa: PSafeArray): HResult; stdcall;
function SafeArrayDestroy(psa: PSafeArray): HResult; stdcall;
function SafeArrayRedim(psa: PSafeArray; var saboundNew: TSafeArrayBound): HResult; stdcall;
function SafeArrayGetDim(psa: PSafeArray): Integer; stdcall;
function SafeArrayGetElemsize(psa: PSafeArray): Integer; stdcall;
function SafeArrayGetUBound(psa: PSafeArray; nDim: Integer; var lUbound: Longint): HResult; stdcall;
function SafeArrayGetLBound(psa: PSafeArray; nDim: Integer; var lLbound: Longint): HResult; stdcall;
function SafeArrayLock(psa: PSafeArray): HResult; stdcall;
function SafeArrayUnlock(psa: PSafeArray): HResult; stdcall;
function SafeArrayAccessData(psa: PSafeArray; var pvData: Pointer): HResult; stdcall;
function SafeArrayUnaccessData(psa: PSafeArray): HResult; stdcall;
function SafeArrayGetElement(psa: PSafeArray; const rgIndices; var pv): HResult; stdcall;
function SafeArrayPutElement(psa: PSafeArray; const rgIndices; const pv): HResult; stdcall;
function SafeArrayCopy(psa: PSafeArray; var psaOut: PSafeArray): HResult; stdcall;
function SafeArrayPtrOfIndex(psa: PSafeArray; var rgIndices; var pvData: Pointer): HResult; stdcall;
{ Variant API }
procedure VariantInit(var varg: Variant); stdcall;
function VariantClear(var varg: Variant): HResult; stdcall;
function VariantCopy(var vargDest: Variant; const vargSrc: Variant): HResult; stdcall;
function VariantCopyInd(var varDest: Variant; const vargSrc: Variant): HResult; stdcall;
function VariantChangeType(var vargDest: Variant; const vargSrc: Variant;
wFlags: Word; vt: TVarType): HResult; stdcall;
function VariantChangeTypeEx(var vargDest: Variant; const vargSrc: Variant;
lcid: TLCID; wFlags: Word; vt: TVarType): HResult; stdcall;
{ VarType coercion API }
{ Note: The routines that convert from a string are defined
to take a POleStr rather than a TBStr because no allocation is
required, and this makes the routines a bit more generic.
They may of course still be passed a TBStr as the strIn param. }
{ 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. In addition, the
VarDateFromStr functions also accepts the VAR_TIMEVALUEONLY and
VAR_DATEVALUEONLY flags }
function VarUI1FromI2(sIn: Smallint; var bOut: Byte): HResult; stdcall;
function VarUI1FromI4(lIn: Longint; var bOut: Byte): HResult; stdcall;
function VarUI1FromR4(fltIn: Single; var bOut: Byte): HResult; stdcall;
function VarUI1FromR8(dblIn: Double; var bOut: Byte): HResult; stdcall;
function VarUI1FromCy(cyIn: TCurrency; var bOut: Byte): HResult; stdcall;
function VarUI1FromDate(dateIn: TOleDate; var bOut: Byte): HResult; stdcall;
function VarUI1FromStr(strIn: TBStr; lcid: TLCID; dwFlags: Longint; var bOut: Byte): HResult; stdcall;
function VarUI1FromDisp(dispIn: IDispatch; lcid: TLCID; var bOut: Byte): HResult; stdcall;
function VarUI1FromBool(boolIn: TOleBool; var bOut: Byte): HResult; stdcall;
function VarI2FromUI1(bIn: Byte; var sOut: Smallint): HResult; stdcall;
function VarI2FromI4(lIn: Longint; var sOut: Smallint): HResult; stdcall;
function VarI2FromR4(fltIn: Single; var sOut: Smallint): HResult; stdcall;
function VarI2FromR8(dblIn: Double; var sOut: Smallint): HResult; stdcall;
function VarI2FromCy(cyIn: TCurrency; var sOut: Smallint): HResult; stdcall;
function VarI2FromDate(dateIn: TOleDate; var sOut: Smallint): HResult; stdcall;
function VarI2FromStr(strIn: TBStr; lcid: TLCID; dwFlags: Longint; var sOut: Smallint): HResult; stdcall;
function VarI2FromDisp(dispIn: IDispatch; lcid: TLCID; var sOut: Smallint): HResult; stdcall;
function VarI2FromBool(boolIn: TOleBool; var sOut: Smallint): HResult; stdcall;
function VarI4FromUI1(bIn: Byte; var lOut: Longint): HResult; stdcall;
function VarI4FromI2(sIn: Smallint; var lOut: Longint): HResult; stdcall;
function VarI4FromR4(fltIn: Single; var lOut: Longint): HResult; stdcall;
function VarI4FromR8(dblIn: Double; var lOut: Longint): HResult; stdcall;
function VarI4FromCy(cyIn: TCurrency; var lOut: Longint): HResult; stdcall;
function VarI4FromDate(dateIn: TOleDate; var lOut: Longint): HResult; stdcall;
function VarI4FromStr(strIn: TBStr; lcid: TLCID; dwFlags: Longint; var lOut: Longint): HResult; stdcall;
function VarI4FromDisp(dispIn: IDispatch; lcid: TLCID; var lOut: Longint): HResult; stdcall;
function VarI4FromBool(boolIn: TOleBool; var lOut: Longint): HResult; stdcall;
function VarR4FromUI1(bIn: Byte; var fltOut: Single): HResult; stdcall;
function VarR4FromI2(sIn: Smallint; var fltOut: Single): HResult; stdcall;
function VarR4FromI4(lIn: Longint; var fltOut: Single): HResult; stdcall;
function VarR4FromR8(dblIn: Double; var fltOut: Single): HResult; stdcall;
function VarR4FromCy(cyIn: TCurrency; var fltOut: Single): HResult; stdcall;
function VarR4FromDate(dateIn: TOleDate; var fltOut: Single): HResult; stdcall;
function VarR4FromStr(strIn: TBStr; lcid: TLCID; dwFlags: Longint; var fltOut: Single): HResult; stdcall;
function VarR4FromDisp(dispIn: IDispatch; lcid: TLCID; var fltOut: Single): HResult; stdcall;
function VarR4FromBool(boolIn: TOleBool; var fltOut: Single): HResult; stdcall;
function VarR8FromUI1(bIn: Byte; var dblOut: Double): HResult; stdcall;
function VarR8FromI2(sIn: Smallint; var dblOut: Double): HResult; stdcall;
function VarR8FromI4(lIn: Longint; var dblOut: Double): HResult; stdcall;
function VarR8FromR4(fltIn: Single; var dblOut: Double): HResult; stdcall;
function VarR8FromCy(cyIn: TCurrency; var dblOut: Double): HResult; stdcall;
function VarR8FromDate(dateIn: TOleDate; var dblOut: Double): HResult; stdcall;
function VarR8FromStr(strIn: TBStr; lcid: TLCID; dwFlags: Longint; var dblOut: Double): HResult; stdcall;
function VarR8FromDisp(dispIn: IDispatch; lcid: TLCID; var dblOut: Double): HResult; stdcall;
function VarR8FromBool(boolIn: TOleBool; var dblOut: Double): HResult; stdcall;
function VarDateFromUI1(bIn: Byte; var dateOut: TOleDate): HResult; stdcall;
function VarDateFromI2(sIn: Smallint; var dateOut: TOleDate): HResult; stdcall;
function VarDateFromI4(lIn: Longint; var dateOut: TOleDate): HResult; stdcall;
function VarDateFromR4(fltIn: Single; var dateOut: TOleDate): HResult; stdcall;
function VarDateFromR8(dblIn: Double; var dateOut: TOleDate): HResult; stdcall;
function VarDateFromCy(cyIn: TCurrency; var dateOut: TOleDate): HResult; stdcall;
function VarDateFromStr(strIn: TBStr; lcid: TLCID; dwFlags: Longint; var dateOut: TOleDate): HResult; stdcall;
function VarDateFromDisp(dispIn: IDispatch; lcid: TLCID; var dateOut: TOleDate): HResult; stdcall;
function VarDateFromBool(boolIn: TOleBool; var dateOut: TOleDate): HResult; stdcall;
function VarCyFromUI1(bIn: Byte; var cyOut: TCurrency): HResult; stdcall;
function VarCyFromI2(sIn: Smallint; var cyOut: TCurrency): HResult; stdcall;
function VarCyFromI4(lIn: Longint; var cyOut: TCurrency): HResult; stdcall;
function VarCyFromR4(fltIn: Single; var cyOut: TCurrency): HResult; stdcall;
function VarCyFromR8(dblIn: Double; var cyOut: TCurrency): HResult; stdcall;
function VarCyFromDate(dateIn: TOleDate; var cyOut: TCurrency): HResult; stdcall;
function VarCyFromStr(strIn: TBStr; lcid: TLCID; dwFlags: Longint; var cyOut: TCurrency): HResult; stdcall;
function VarCyFromDisp(dispIn: IDispatch; lcid: TLCID; var cyOut: TCurrency): HResult; stdcall;
function VarCyFromBool(boolIn: TOleBool; var cyOut: TCurrency): HResult; stdcall;
function VarBStrFromUI1(bVal: Byte; lcid: TLCID; dwFlags: Longint; var bstrOut: TBStr): HResult; stdcall;
function VarBStrFromI2(iVal: Smallint; lcid: TLCID; dwFlags: Longint; var bstrOut: TBStr): HResult; stdcall;
function VarBStrFromI4(lIn: Longint; lcid: TLCID; dwFlags: Longint; var bstrOut: TBStr): HResult; stdcall;
function VarBStrFromR4(fltIn: Single; lcid: TLCID; dwFlags: Longint; var bstrOut: TBStr): HResult; stdcall;
function VarBStrFromR8(dblIn: Double; lcid: TLCID; dwFlags: Longint; var bstrOut: TBStr): HResult; stdcall;
function VarBStrFromCy(cyIn: TCurrency; lcid: TLCID; dwFlags: Longint; var bstrOut: TBStr): HResult; stdcall;
function VarBStrFromDate(dateIn: TOleDate; lcid: TLCID; dwFlags: Longint; var bstrOut: TBStr): HResult; stdcall;
function VarBStrFromDisp(dispIn: IDispatch; lcid: TLCID; dwFlags: Longint; var bstrOut: TBStr): HResult; stdcall;
function VarBStrFromBool(boolIn: TOleBool; lcid: TLCID; dwFlags: Longint; var bstrOut: TBStr): HResult; stdcall;
function VarBoolFromUI1(bIn: Byte; var boolOut: TOleBool): HResult; stdcall;
function VarBoolFromI2(sIn: Smallint; var boolOut: TOleBool): HResult; stdcall;
function VarBoolFromI4(lIn: Longint; var boolOut: TOleBool): HResult; stdcall;
function VarBoolFromR4(fltIn: Single; var boolOut: TOleBool): HResult; stdcall;
function VarBoolFromR8(dblIn: Double; var boolOut: TOleBool): HResult; stdcall;
function VarBoolFromDate(dateIn: TOleDate; var boolOut: TOleBool): HResult; stdcall;
function VarBoolFromCy(cyIn: TCurrency; var boolOut: TOleBool): HResult; stdcall;
function VarBoolFromStr(strIn: TBStr; lcid: TLCID; dwFlags: Longint; var boolOut: TOleBool): HResult; stdcall;
function VarBoolFromDisp(dispIn: IDispatch; lcid: TLCID; var boolOut: TOleBool): HResult; stdcall;
{ TypeInfo API }
function LHashValOfNameSys(syskind: TSysKind; lcid: TLCID;
szName: POleStr): Longint; stdcall;
function LHashValOfNameSysA(syskind: TSysKind; lcid: TLCID;
szName: PChar): Longint; stdcall;
function LHashValOfName(lcid: TLCID; szName: POleStr): Longint;
function WHashValOfLHashVal(lhashval: Longint): Word;
function IsHashValCompatible(lhashval1, lhashval2: Longint): Boolean;
function LoadTypeLib(szFile: POleStr; var tlib: ITypeLib): HResult; stdcall;
function LoadRegTypeLib(const guid: TGUID; wVerMajor, wVerMinor: Word;
lcid: TLCID; var tlib: ITypeLib): HResult; stdcall;
function QueryPathOfRegTypeLib(const guid: TGUID; wMaj, wMin: Word;
lcid: TLCID; var bstrPathName: TBStr): HResult; stdcall;
function RegisterTypeLib(tlib: ITypeLib; szFullPath, szHelpDir: POleStr): HResult; stdcall;
function CreateTypeLib(syskind: TSysKind; szFile: POleStr;
var ctlib: ICreateTypeLib): HResult; stdcall;
{ IDispatch implementation support }
function DispGetParam(var dispparams: TDispParams; position: Integer;
vtTarg: TVarType; var varResult: Variant; var puArgErr: Integer): HResult; stdcall;
function DispGetIDsOfNames(tinfo: ITypeInfo; var rgszNames; cNames: Integer;
var rgdispid): HResult; stdcall;
function DispInvoke(This: Pointer; tinfo: ITypeInfo; dispidMember: TDispID;
wFlags: Word; var params: TDispParams; var varResult: Variant;
var excepinfo: TExcepInfo; var puArgErr: Integer): HResult; stdcall;
function CreateDispTypeInfo(var idata: TInterfaceData; lcid: TLCID;
var tinfo: ITypeInfo): HResult; stdcall;
function CreateStdDispatch(unkOuter: IUnknown; pvThis: Pointer;
tinfo: ITypeInfo; var unkStdDisp: IUnknown): HResult; stdcall;
{ Active object registration API }
function RegisterActiveObject(unk: IUnknown; const clsid: TCLSID;
dwFlags: Longint; var dwRegister: Longint): HResult; stdcall;
function RevokeActiveObject(dwRegister: Longint; pvReserved: Pointer): HResult; stdcall;
function GetActiveObject(const clsid: TCLSID; pvReserved: Pointer;
var unk: IUnknown): HResult; stdcall;
{ ErrorInfo API }
function SetErrorInfo(dwReserved: Longint; errinfo: IErrorInfo): HResult; stdcall;
function GetErrorInfo(dwReserved: Longint; var errinfo: IErrorInfo): HResult; stdcall;
function CreateErrorInfo(var errinfo: ICreateErrorInfo): HResult; stdcall;
{ Misc API }
function OaBuildVersion: Longint; stdcall;
{ OLE API prototypes }
function OleBuildVersion: HResult; stdcall;
{ helper functions }
function ReadClassStg(stg: IStorage; var clsid: TCLSID): HResult; stdcall;
function WriteClassStg(stg: IStorage; const clsid: TIID): HResult; stdcall;
function ReadClassStm(stm: IStream; var clsid: TCLSID): HResult; stdcall;
function WriteClassStm(stm: IStream; const clsid: TIID): HResult; stdcall;
function WriteFmtUserTypeStg(stg: IStorage; cf: TClipFormat;
pszUserType: POleStr): HResult; stdcall;
function ReadFmtUserTypeStg(stg: IStorage; var cf: TClipFormat;
var pszUserType: POleStr): HResult; stdcall;
{ Initialization and termination }
function OleInitialize(pwReserved: Pointer): HResult; stdcall;
procedure OleUninitialize; stdcall;
{ APIs to query whether (Embedded/Linked) object can be created from
the data object }
function OleQueryLinkFromData(srcDataObject: IDataObject): HResult; stdcall;
function OleQueryCreateFromData(srcDataObject: IDataObject): HResult; stdcall;
{ Object creation APIs }
function OleCreate(const clsid: TCLSID; const iid: TIID; renderopt: Longint;
formatEtc: PFormatEtc; clientSite: IOleClientSite;
stg: IStorage; var vObj): HResult; stdcall;
function OleCreateFromData(srcDataObj: IDataObject; const iid: TIID;
renderopt: Longint; formatEtc: PFormatEtc; clientSite: IOleClientSite;
stg: IStorage; var vObj): HResult; stdcall;
function OleCreateLinkFromData(srcDataObj: IDataObject; const iid: TIID;
renderopt: Longint; formatEtc: PFormatEtc; clientSite: IOleClientSite;
stg: IStorage; var vObj): HResult; stdcall;
function OleCreateStaticFromData(srcDataObj: IDataObject; const iid: TIID;
renderopt: Longint; formatEtc: PFormatEtc; clientSite: IOleClientSite;
stg: IStorage; var vObj): HResult; stdcall;
function OleCreateLink(mkLinkSrc: IMoniker; const iid: TIID;
renderopt: Longint; formatEtc: PFormatEtc; clientSite: IOleClientSite;
stg: IStorage; var vObj): HResult; stdcall;
function OleCreateLinkToFile(pszFileName: POleStr; const iid: TIID;
renderopt: Longint; formatEtc: PFormatEtc; clientSite: IOleClientSite;
stg: IStorage; var vObj): HResult; stdcall;
function OleCreateFromFile(const clsid: TCLSID; pszFileName: POleStr;
const iid: TIID; renderopt: Longint; formatEtc: PFormatEtc;
clientSite: IOleClientSite; stg: IStorage; var vObj): HResult; stdcall;
function OleLoad(stg: IStorage; const iid: TIID; clientSite: IOleClientSite;
var vObj): HResult; stdcall;
function OleSave(ps: IPersistStorage; stg: IStorage; fSameAsLoad: BOOL): HResult; stdcall;
function OleLoadFromStream(stm: IStream; const iidInterface: TIID;
var vObj): HResult; stdcall;
function OleSaveToStream(pstm: IPersistStream; stm: IStream): HResult; stdcall;
function OleSetContainedObject(unknown: IUnknown; fContained: BOOL): HResult; stdcall;
function OleNoteObjectVisible(unknown: IUnknown; fVisible: BOOL): HResult; stdcall;
{ DragDrop APIs }
function RegisterDragDrop(wnd: HWnd; dropTarget: IDropTarget): HResult; stdcall;
function RevokeDragDrop(wnd: HWnd): HResult; stdcall;
function DoDragDrop(dataObj: IDataObject; dropSource: IDropSource;
dwOKEffects: Longint; var dwEffect: Longint): HResult; stdcall;
{ Clipboard APIs }
function OleSetClipboard(dataObj: IDataObject): HResult; stdcall;
function OleGetClipboard(var dataObj: IDataObject): HResult; stdcall;
function OleFlushClipboard: HResult; stdcall;
function OleIsCurrentClipboard(dataObj: IDataObject): HResult; stdcall;
{ In-place editing APIs }
function OleCreateMenuDescriptor(hmenuCombined: HMenu;
var menuWidths: TOleMenuGroupWidths): HMenu; stdcall;
function OleSetMenuDescriptor(holemenu: HMenu; hwndFrame: HWnd;
hwndActiveObject: HWnd; frame: IOleInPlaceFrame;
activeObj: IOleInPlaceActiveObject): HResult; stdcall;
function OleDestroyMenuDescriptor(holemenu: HMenu): HResult; stdcall;
function OleTranslateAccelerator(frame: IOleInPlaceFrame;
var frameInfo: TOleInPlaceFrameInfo; msg: PMsg): HResult; stdcall;
{ Helper APIs }
function OleDuplicateData(hSrc: THandle; cfFormat: TClipFormat;
uiFlags: Integer): THandle; stdcall;
function OleDraw(unknown: IUnknown; dwAspect: Longint; hdcDraw: HDC;
const rcBounds: TRect): HResult; stdcall;
function OleRun(unknown: IUnknown): HResult; stdcall;
function OleIsRunning(obj: IOleObject): BOOL; stdcall;
function OleLockRunning(unknown: IUnknown; fLock: BOOL;
fLastUnlockCloses: BOOL): HResult; stdcall;
procedure ReleaseStgMedium(var medium: TStgMedium); stdcall;
function CreateOleAdviseHolder(var OAHolder: IOleAdviseHolder): HResult; stdcall;
function OleCreateDefaultHandler(const clsid: TCLSID; unkOuter: IUnknown;
const iid: TIID; var vObj): HResult; stdcall;
function OleCreateEmbeddingHelper(const clsid: TCLSID; unkOuter: IUnknown;
flags: Longint; cf: IClassFactory; const iid: TIID; var vObj): HResult; stdcall;
function IsAccelerator(accel: HAccel; cAccelEntries: Integer; msg: PMsg;
var pwCmd: Word): BOOL; stdcall;
{ Icon extraction helper APIs }
function OleGetIconOfFile(pszPath: POleStr; fUseFileAsLabel: BOOL): HGlobal; stdcall;
function OleGetIconOfClass(const clsid: TCLSID; pszLabel: POleStr;
fUseTypeAsLabel: BOOL): HGlobal; stdcall;
function OleMetafilePictFromIconAndLabel(icon: HIcon; pszLabel: POleStr;
pszSourceFile: POleStr; iIconIndex: Integer): HGlobal; stdcall;
{ Registration database helper APIs }
function OleRegGetUserType(const clsid: TCLSID; dwFormOfType: Longint;
var pszUserType: POleStr): HResult; stdcall;
function OleRegGetMiscStatus(const clsid: TCLSID; dwAspect: Longint;
var dwStatus: Longint): HResult; stdcall;
function OleRegEnumFormatEtc(const clsid: TCLSID; dwDirection: Longint;
var Enum: IEnumFormatEtc): HResult; stdcall;
function OleRegEnumVerbs(const clsid: TCLSID;
var Enum: IEnumOleVerb): HResult; stdcall;
{ OLE 1.0 conversion APIs }
function OleConvertIStorageToOLESTREAM(stg: IStorage;
polestm: Pointer): HResult; stdcall;
function OleConvertOLESTREAMToIStorage(polestm: Pointer; stg: IStorage;
td: PDVTargetDevice): HResult; stdcall;
function OleConvertIStorageToOLESTREAMEx(stg: IStorage; cfFormat: TClipFormat;
lWidth: Longint; lHeight: Longint; dwSize: Longint; var medium: TStgMedium;
polestm: Pointer): HResult; stdcall;
function OleConvertOLESTREAMToIStorageEx(polestm: Pointer; stg: IStorage;
var cfFormat: TClipFormat; var lWidth: Longint; var lHeight: Longint;
var dwSize: Longint; var medium: TStgMedium): HResult; stdcall;
{ Storage utility APIs }
function GetHGlobalFromILockBytes(lkbyt: ILockBytes; var hglob: HGlobal): HResult; stdcall;
function CreateILockBytesOnHGlobal(hglob: HGlobal; fDeleteOnRelease: BOOL;
var lkbyt: ILockBytes): HResult; stdcall;
function GetHGlobalFromStream(stm: IStream; var hglob: HGlobal): HResult; stdcall;
function CreateStreamOnHGlobal(hglob: HGlobal; fDeleteOnRelease: BOOL;
var stm: IStream): HResult; stdcall;
{ ConvertTo APIs }
function OleDoAutoConvert(stg: IStorage; var clsidNew: TCLSID): HResult; stdcall;
function OleGetAutoConvert(const clsidOld: TCLSID; var clsidNew: TCLSID): HResult; stdcall;
function OleSetAutoConvert(const clsidOld: TCLSID; const clsidNew: TCLSID): HResult; stdcall;
function GetConvertStg(stg: IStorage): HResult; stdcall;
function SetConvertStg(stg: IStorage; fConvert: BOOL): HResult; stdcall;
implementation
const
ole32 = 'ole32.dll';
oleaut32 = 'oleaut32.dll';
{ Externals from ole32.dll }
function IsEqualGUID; external ole32 name 'IsEqualGUID';
function IsEqualIID; external ole32 name 'IsEqualGUID';
function IsEqualCLSID; external ole32 name 'IsEqualGUID';
function CoBuildVersion; external ole32 name 'CoBuildVersion';
function CoInitialize; external ole32 name 'CoInitialize';
procedure CoUninitialize; external ole32 name 'CoUninitialize';
function CoGetMalloc; external ole32 name 'CoGetMalloc';
function CoGetCurrentProcess; external ole32 name 'CoGetCurrentProcess';
function CoRegisterMallocSpy; external ole32 name 'CoRegisterMallocSpy';
function CoRevokeMallocSpy; external ole32 name 'CoRevokeMallocSpy';
function CoCreateStandardMalloc; external ole32 name 'CoCreateStandardMalloc';
function CoGetClassObject; external ole32 name 'CoGetClassObject';
function CoRegisterClassObject; external ole32 name 'CoRegisterClassObject';
function CoRevokeClassObject; external ole32 name 'CoRevokeClassObject';
function CoGetMarshalSizeMax; external ole32 name 'CoGetMarshalSizeMax';
function CoMarshalInterface; external ole32 name 'CoMarshalInterface';
function CoUnmarshalInterface; external ole32 name 'CoUnmarshalInterface';
function CoMarshalHResult; external ole32 name 'CoMarshalHResult';
function CoUnmarshalHResult; external ole32 name 'CoUnmarshalHResult';
function CoReleaseMarshalData; external ole32 name 'CoReleaseMarshalData';
function CoDisconnectObject; external ole32 name 'CoDisconnectObject';
function CoLockObjectExternal; external ole32 name 'CoLockObjectExternal';
function CoGetStandardMarshal; external ole32 name 'CoGetStandardMarshal';
function CoIsHandlerConnected; external ole32 name 'CoIsHandlerConnected';
function CoHasStrongExternalConnections; external ole32 name 'CoHasStrongExternalConnections';
function CoMarshalInterThreadInterfaceInStream; external ole32 name 'CoMarshalInterThreadInterfaceInStream';
function CoGetInterfaceAndReleaseStream; external ole32 name 'CoGetInterfaceAndReleaseStream';
function CoCreateFreeThreadedMarshaler; external ole32 name 'CoCreateFreeThreadedMarshaler';
function CoLoadLibrary; external ole32 name 'CoLoadLibrary';
procedure CoFreeLibrary; external ole32 name 'CoFreeLibrary';
procedure CoFreeAllLibraries; external ole32 name 'CoFreeAllLibraries';
procedure CoFreeUnusedLibraries; external ole32 name 'CoFreeUnusedLibraries';
function CoCreateInstance; external ole32 name 'CoCreateInstance';
function StringFromCLSID; external ole32 name 'StringFromCLSID';
function CLSIDFromString; external ole32 name 'CLSIDFromString';
function StringFromIID; external ole32 name 'StringFromIID';
function IIDFromString; external ole32 name 'IIDFromString';
function CoIsOle1Class; external ole32 name 'CoIsOle1Class';
function ProgIDFromCLSID; external ole32 name 'ProgIDFromCLSID';
function CLSIDFromProgID; external ole32 name 'CLSIDFromProgID';
function StringFromGUID2; external ole32 name 'StringFromGUID2';
function CoCreateGuid; external ole32 name 'CoCreateGuid';
function CoFileTimeToDosDateTime; external ole32 name 'CoFileTimeToDosDateTime';
function CoDosDateTimeToFileTime; external ole32 name 'CoDosDateTimeToFileTime';
function CoFileTimeNow; external ole32 name 'CoFileTimeNow';
function CoRegisterMessageFilter; external ole32 name 'CoRegisterMessageFilter';
function CoGetTreatAsClass; external ole32 name 'CoGetTreatAsClass';
function CoTreatAsClass; external ole32 name 'CoTreatAsClass';
function CoTaskMemAlloc; external ole32 name 'CoTaskMemAlloc';
function CoTaskMemRealloc; external ole32 name 'CoTaskMemRealloc';
procedure CoTaskMemFree; external ole32 name 'CoTaskMemFree';
function CreateDataAdviseHolder; external ole32 name 'CreateDataAdviseHolder';
function CreateDataCache; external ole32 name 'CreateDataCache';
function StgCreateDocfile; external ole32 name 'StgCreateDocfile';
function StgCreateDocfileOnILockBytes; external ole32 name 'StgCreateDocfileOnILockBytes';
function StgOpenStorage; external ole32 name 'StgOpenStorage';
function StgOpenStorageOnILockBytes; external ole32 name 'StgOpenStorageOnILockBytes';
function StgIsStorageFile; external ole32 name 'StgIsStorageFile';
function StgIsStorageILockBytes; external ole32 name 'StgIsStorageILockBytes';
function StgSetTimes; external ole32 name 'StgSetTimes';
function BindMoniker; external ole32 name 'BindMoniker';
function MkParseDisplayName; external ole32 name 'MkParseDisplayName';
function MonikerRelativePathTo; external ole32 name 'MonikerRelativePathTo';
function MonikerCommonPrefixWith; external ole32 name 'MonikerCommonPrefixWith';
function CreateBindCtx; external ole32 name 'CreateBindCtx';
function CreateGenericComposite; external ole32 name 'CreateGenericComposite';
function GetClassFile; external ole32 name 'GetClassFile';
function CreateFileMoniker; external ole32 name 'CreateFileMoniker';
function CreateItemMoniker; external ole32 name 'CreateItemMoniker';
function CreateAntiMoniker; external ole32 name 'CreateAntiMoniker';
function CreatePointerMoniker; external ole32 name 'CreatePointerMoniker';
function GetRunningObjectTable; external ole32 name 'GetRunningObjectTable';
function OleBuildVersion; external ole32 name 'OleBuildVersion';
function ReadClassStg; external ole32 name 'ReadClassStg';
function WriteClassStg; external ole32 name 'WriteClassStg';
function ReadClassStm; external ole32 name 'ReadClassStm';
function WriteClassStm; external ole32 name 'WriteClassStm';
function WriteFmtUserTypeStg; external ole32 name 'WriteFmtUserTypeStg';
function ReadFmtUserTypeStg; external ole32 name 'ReadFmtUserTypeStg';
function OleInitialize; external ole32 name 'OleInitialize';
procedure OleUninitialize; external ole32 name 'OleUninitialize';
function OleQueryLinkFromData; external ole32 name 'OleQueryLinkFromData';
function OleQueryCreateFromData; external ole32 name 'OleQueryCreateFromData';
function OleCreate; external ole32 name 'OleCreate';
function OleCreateFromData; external ole32 name 'OleCreateFromData';
function OleCreateLinkFromData; external ole32 name 'OleCreateLinkFromData';
function OleCreateStaticFromData; external ole32 name 'OleCreateStaticFromData';
function OleCreateLink; external ole32 name 'OleCreateLink';
function OleCreateLinkToFile; external ole32 name 'OleCreateLinkToFile';
function OleCreateFromFile; external ole32 name 'OleCreateFromFile';
function OleLoad; external ole32 name 'OleLoad';
function OleSave; external ole32 name 'OleSave';
function OleLoadFromStream; external ole32 name 'OleLoadFromStream';
function OleSaveToStream; external ole32 name 'OleSaveToStream';
function OleSetContainedObject; external ole32 name 'OleSetContainedObject';
function OleNoteObjectVisible; external ole32 name 'OleNoteObjectVisible';
function RegisterDragDrop; external ole32 name 'RegisterDragDrop';
function RevokeDragDrop; external ole32 name 'RevokeDragDrop';
function DoDragDrop; external ole32 name 'DoDragDrop';
function OleSetClipboard; external ole32 name 'OleSetClipboard';
function OleGetClipboard; external ole32 name 'OleGetClipboard';
function OleFlushClipboard ; external ole32 name 'OleFlushClipboard';
function OleIsCurrentClipboard; external ole32 name 'OleIsCurrentClipboard';
function OleCreateMenuDescriptor; external ole32 name 'OleCreateMenuDescriptor';
function OleSetMenuDescriptor; external ole32 name 'OleSetMenuDescriptor';
function OleDestroyMenuDescriptor; external ole32 name 'OleDestroyMenuDescriptor';
function OleTranslateAccelerator; external ole32 name 'OleTranslateAccelerator';
function OleDuplicateData; external ole32 name 'OleDuplicateData';
function OleDraw; external ole32 name 'OleDraw';
function OleRun; external ole32 name 'OleRun';
function OleIsRunning; external ole32 name 'OleIsRunning';
function OleLockRunning; external ole32 name 'OleLockRunning';
procedure ReleaseStgMedium; external ole32 name 'ReleaseStgMedium';
function CreateOleAdviseHolder; external ole32 name 'CreateOleAdviseHolder';
function OleCreateDefaultHandler; external ole32 name 'OleCreateDefaultHandler';
function OleCreateEmbeddingHelper; external ole32 name 'OleCreateEmbeddingHelper';
function IsAccelerator; external ole32 name 'IsAccelerator';
function OleGetIconOfFile; external ole32 name 'OleGetIconOfFile';
function OleGetIconOfClass; external ole32 name 'OleGetIconOfClass';
function OleMetafilePictFromIconAndLabel; external ole32 name 'OleMetafilePictFromIconAndLabel';
function OleRegGetUserType; external ole32 name 'OleRegGetUserType';
function OleRegGetMiscStatus; external ole32 name 'OleRegGetMiscStatus';
function OleRegEnumFormatEtc; external ole32 name 'OleRegEnumFormatEtc';
function OleRegEnumVerbs; external ole32 name 'OleRegEnumVerbs';
function OleConvertIStorageToOLESTREAM; external ole32 name 'OleConvertIStorageToOLESTREAM';
function OleConvertOLESTREAMToIStorage; external ole32 name 'OleConvertOLESTREAMToIStorage';
function OleConvertIStorageToOLESTREAMEx; external ole32 name 'OleConvertIStorageToOLESTREAMEx';
function OleConvertOLESTREAMToIStorageEx; external ole32 name 'OleConvertOLESTREAMToIStorageEx';
function GetHGlobalFromILockBytes; external ole32 name 'GetHGlobalFromILockBytes';
function CreateILockBytesOnHGlobal; external ole32 name 'CreateILockBytesOnHGlobal';
function GetHGlobalFromStream; external ole32 name 'GetHGlobalFromStream';
function CreateStreamOnHGlobal; external ole32 name 'CreateStreamOnHGlobal';
function OleDoAutoConvert; external ole32 name 'OleDoAutoConvert';
function OleGetAutoConvert; external ole32 name 'OleGetAutoConvert';
function OleSetAutoConvert; external ole32 name 'OleSetAutoConvert';
function GetConvertStg; external ole32 name 'GetConvertStg';
function SetConvertStg; external ole32 name 'SetConvertStg';
{ Externals from oleaut32.dll }
function SysAllocString; external oleaut32 name 'SysAllocString';
function SysReAllocString; external oleaut32 name 'SysReAllocString';
function SysAllocStringLen; external oleaut32 name 'SysAllocStringLen';
function SysReAllocStringLen; external oleaut32 name 'SysReAllocStringLen';
procedure SysFreeString; external oleaut32 name 'SysFreeString';
function SysStringLen; external oleaut32 name 'SysStringLen';
function SysStringByteLen; external oleaut32 name 'SysStringByteLen';
function SysAllocStringByteLen; external oleaut32 name 'SysAllocStringByteLen';
function DosDateTimeToVariantTime; external oleaut32 name 'DosDateTimeToVariantTime';
function VariantTimeToDosDateTime; external oleaut32 name 'VariantTimeToDosDateTime';
function SafeArrayAllocDescriptor; external oleaut32 name 'SafeArrayAllocDescriptor';
function SafeArrayAllocData; external oleaut32 name 'SafeArrayAllocData';
function SafeArrayCreate; external oleaut32 name 'SafeArrayCreate';
function SafeArrayDestroyDescriptor; external oleaut32 name 'SafeArrayDestroyDescriptor';
function SafeArrayDestroyData; external oleaut32 name 'SafeArrayDestroyData';
function SafeArrayDestroy; external oleaut32 name 'SafeArrayDestroy';
function SafeArrayRedim; external oleaut32 name 'SafeArrayRedim';
function SafeArrayGetDim; external oleaut32 name 'SafeArrayGetDim';
function SafeArrayGetElemsize; external oleaut32 name 'SafeArrayGetElemsize';
function SafeArrayGetUBound; external oleaut32 name 'SafeArrayGetUBound';
function SafeArrayGetLBound; external oleaut32 name 'SafeArrayGetLBound';
function SafeArrayLock; external oleaut32 name 'SafeArrayLock';
function SafeArrayUnlock; external oleaut32 name 'SafeArrayUnlock';
function SafeArrayAccessData; external oleaut32 name 'SafeArrayAccessData';
function SafeArrayUnaccessData; external oleaut32 name 'SafeArrayUnaccessData';
function SafeArrayGetElement; external oleaut32 name 'SafeArrayGetElement';
function SafeArrayPutElement; external oleaut32 name 'SafeArrayPutElement';
function SafeArrayCopy; external oleaut32 name 'SafeArrayCopy';
function SafeArrayPtrOfIndex; external oleaut32 name 'SafeArrayPtrOfIndex';
procedure VariantInit; external oleaut32 name 'VariantInit';
function VariantClear; external oleaut32 name 'VariantClear';
function VariantCopy; external oleaut32 name 'VariantCopy';
function VariantCopyInd; external oleaut32 name 'VariantCopyInd';
function VariantChangeType; external oleaut32 name 'VariantChangeType';
function VariantChangeTypeEx; external oleaut32 name 'VariantChangeTypeEx';
function VarUI1FromI2; external oleaut32 name 'VarUI1FromI2';
function VarUI1FromI4; external oleaut32 name 'VarUI1FromI4';
function VarUI1FromR4; external oleaut32 name 'VarUI1FromR4';
function VarUI1FromR8; external oleaut32 name 'VarUI1FromR8';
function VarUI1FromCy; external oleaut32 name 'VarUI1FromCy';
function VarUI1FromDate; external oleaut32 name 'VarUI1FromDate';
function VarUI1FromStr; external oleaut32 name 'VarUI1FromStr';
function VarUI1FromDisp; external oleaut32 name 'VarUI1FromDisp';
function VarUI1FromBool; external oleaut32 name 'VarUI1FromBool';
function VarI2FromUI1; external oleaut32 name 'VarI2FromUI1';
function VarI2FromI4; external oleaut32 name 'VarI2FromI4';
function VarI2FromR4; external oleaut32 name 'VarI2FromR4';
function VarI2FromR8; external oleaut32 name 'VarI2FromR8';
function VarI2FromCy; external oleaut32 name 'VarI2FromCy';
function VarI2FromDate; external oleaut32 name 'VarI2FromDate';
function VarI2FromStr; external oleaut32 name 'VarI2FromStr';
function VarI2FromDisp; external oleaut32 name 'VarI2FromDisp';
function VarI2FromBool; external oleaut32 name 'VarI2FromBool';
function VarI4FromUI1; external oleaut32 name 'VarI4FromUI1';
function VarI4FromI2; external oleaut32 name 'VarI4FromI2';
function VarI4FromR4; external oleaut32 name 'VarI4FromR4';
function VarI4FromR8; external oleaut32 name 'VarI4FromR8';
function VarI4FromCy; external oleaut32 name 'VarI4FromCy';
function VarI4FromDate; external oleaut32 name 'VarI4FromDate';
function VarI4FromStr; external oleaut32 name 'VarI4FromStr';
function VarI4FromDisp; external oleaut32 name 'VarI4FromDisp';
function VarI4FromBool; external oleaut32 name 'VarI4FromBool';
function VarR4FromUI1; external oleaut32 name 'VarR4FromUI1';
function VarR4FromI2; external oleaut32 name 'VarR4FromI2';
function VarR4FromI4; external oleaut32 name 'VarR4FromI4';
function VarR4FromR8; external oleaut32 name 'VarR4FromR8';
function VarR4FromCy; external oleaut32 name 'VarR4FromCy';
function VarR4FromDate; external oleaut32 name 'VarR4FromDate';
function VarR4FromStr; external oleaut32 name 'VarR4FromStr';
function VarR4FromDisp; external oleaut32 name 'VarR4FromDisp';
function VarR4FromBool; external oleaut32 name 'VarR4FromBool';
function VarR8FromUI1; external oleaut32 name 'VarR8FromUI1';
function VarR8FromI2; external oleaut32 name 'VarR8FromI2';
function VarR8FromI4; external oleaut32 name 'VarR8FromI4';
function VarR8FromR4; external oleaut32 name 'VarR8FromR4';
function VarR8FromCy; external oleaut32 name 'VarR8FromCy';
function VarR8FromDate; external oleaut32 name 'VarR8FromDate';
function VarR8FromStr; external oleaut32 name 'VarR8FromStr';
function VarR8FromDisp; external oleaut32 name 'VarR8FromDisp';
function VarR8FromBool; external oleaut32 name 'VarR8FromBool';
function VarDateFromUI1; external oleaut32 name 'VarDateFromUI1';
function VarDateFromI2; external oleaut32 name 'VarDateFromI2';
function VarDateFromI4; external oleaut32 name 'VarDateFromI4';
function VarDateFromR4; external oleaut32 name 'VarDateFromR4';
function VarDateFromR8; external oleaut32 name 'VarDateFromR8';
function VarDateFromCy; external oleaut32 name 'VarDateFromCy';
function VarDateFromStr; external oleaut32 name 'VarDateFromStr';
function VarDateFromDisp; external oleaut32 name 'VarDateFromDisp';
function VarDateFromBool; external oleaut32 name 'VarDateFromBool';
function VarCyFromUI1; external oleaut32 name 'VarCyFromUI1';
function VarCyFromI2; external oleaut32 name 'VarCyFromI2';
function VarCyFromI4; external oleaut32 name 'VarCyFromI4';
function VarCyFromR4; external oleaut32 name 'VarCyFromR4';
function VarCyFromR8; external oleaut32 name 'VarCyFromR8';
function VarCyFromDate; external oleaut32 name 'VarCyFromDate';
function VarCyFromStr; external oleaut32 name 'VarCyFromStr';
function VarCyFromDisp; external oleaut32 name 'VarCyFromDisp';
function VarCyFromBool; external oleaut32 name 'VarCyFromBool';
function VarBStrFromUI1; external oleaut32 name 'VarBStrFromUI1';
function VarBStrFromI2; external oleaut32 name 'VarBStrFromI2';
function VarBStrFromI4; external oleaut32 name 'VarBStrFromI4';
function VarBStrFromR4; external oleaut32 name 'VarBStrFromR4';
function VarBStrFromR8; external oleaut32 name 'VarBStrFromR8';
function VarBStrFromCy; external oleaut32 name 'VarBStrFromCy';
function VarBStrFromDate; external oleaut32 name 'VarBStrFromDate';
function VarBStrFromDisp; external oleaut32 name 'VarBStrFromDisp';
function VarBStrFromBool; external oleaut32 name 'VarBStrFromBool';
function VarBoolFromUI1; external oleaut32 name 'VarBoolFromUI1';
function VarBoolFromI2; external oleaut32 name 'VarBoolFromI2';
function VarBoolFromI4; external oleaut32 name 'VarBoolFromI4';
function VarBoolFromR4; external oleaut32 name 'VarBoolFromR4';
function VarBoolFromR8; external oleaut32 name 'VarBoolFromR8';
function VarBoolFromDate; external oleaut32 name 'VarBoolFromDate';
function VarBoolFromCy; external oleaut32 name 'VarBoolFromCy';
function VarBoolFromStr; external oleaut32 name 'VarBoolFromStr';
function VarBoolFromDisp; external oleaut32 name 'VarBoolFromDisp';
function LHashValOfNameSys; external oleaut32 name 'LHashValOfNameSys';
function LHashValOfNameSysA; external oleaut32 name 'LHashValOfNameSysA';
function LoadTypeLib; external oleaut32 name 'LoadTypeLib';
function LoadRegTypeLib; external oleaut32 name 'LoadRegTypeLib';
function QueryPathOfRegTypeLib; external oleaut32 name 'QueryPathOfRegTypeLib';
function RegisterTypeLib; external oleaut32 name 'RegisterTypeLib';
function CreateTypeLib; external oleaut32 name 'CreateTypeLib';
function DispGetParam; external oleaut32 name 'DispGetParam';
function DispGetIDsOfNames; external oleaut32 name 'DispGetIDsOfNames';
function DispInvoke; external oleaut32 name 'DispInvoke';
function CreateDispTypeInfo; external oleaut32 name 'CreateDispTypeInfo';
function CreateStdDispatch; external oleaut32 name 'CreateStdDispatch';
function RegisterActiveObject; external oleaut32 name 'RegisterActiveObject';
function RevokeActiveObject; external oleaut32 name 'RevokeActiveObject';
function GetActiveObject; external oleaut32 name 'GetActiveObject';
function SetErrorInfo; external oleaut32 name 'SetErrorInfo';
function GetErrorInfo; external oleaut32 name 'GetErrorInfo';
function CreateErrorInfo; external oleaut32 name 'CreateErrorInfo';
function OaBuildVersion; external oleaut32 name 'OaBuildVersion';
{ Helper functions }
function Succeeded(Res: HResult): Boolean;
begin
Result := Res >= 0;
end;
function Failed(Res: HResult): Boolean;
begin
Result := Res < 0;
end;
function ResultCode(Res: HResult): Integer;
begin
Result := Res and $0000FFFF;
end;
function ResultFacility(Res: HResult): Integer;
begin
Result := (Res shr 16) and $00001FFF;
end;
function ResultSeverity(Res: HResult): Integer;
begin
Result := Res shr 31;
end;
function MakeResult(Severity, Facility, Code: Integer): HResult;
begin
Result := (Severity shl 31) or (Facility shl 16) or Code;
end;
function LHashValOfName(lcid: TLCID; szName: POleStr): Longint;
begin
Result := LHashValOfNameSys(SYS_WIN32, lcid, szName);
end;
function WHashValOfLHashVal(lhashval: Longint): Word;
begin
Result := lhashval and $0000FFFF;
end;
function IsHashValCompatible(lhashval1, lhashval2: Longint): Boolean;
begin
Result := lhashval1 and $00FF0000 = lhashval2 and $00FF0000;
end;
end.