home *** CD-ROM | disk | FTP | other *** search
/ PC Format Collection 48 / SENT14D.ISO / tech / delphi / disk14 / doc.pak / OLE2.INT < prev    next >
Encoding:
Text File  |  1995-08-24  |  88.4 KB  |  2,176 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Runtime Library                          }
  5. {       Windows 3.1 API Interface Unit                  }
  6. {                                                       }
  7. {       Copyright (c) 1992,93 Borland International     }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit OLE2;
  12.  
  13. interface
  14.  
  15. uses WinTypes;
  16.  
  17. type
  18.   HIcon = THandle;
  19.   HGlobal = THandle;
  20.   HMenu = THandle;
  21.   HAccel = THandle;
  22.   HTask = THandle;
  23.   HResult = Pointer;
  24.   SCode = Longint;
  25.   Largeint = Comp;
  26.   ULargeint = Comp;
  27.  
  28. const
  29.  
  30.   { verbs }
  31.   OLEIVERB_PRIMARY = 0;
  32.   OLEIVERB_SHOW = -1;
  33.   OLEIVERB_OPEN = -2;
  34.   OLEIVERB_HIDE = -3;
  35.   OLEIVERB_UIACTIVATE = -4;
  36.   OLEIVERB_INPLACEACTIVATE = -5;
  37.   OLEIVERB_DISCARDUNDOSTATE = -6;
  38.  
  39.   NULL = 0;
  40.   NOERROR = 0;
  41.  
  42.   { Severity values}
  43.   SEVERITY_SUCCESS = 0;
  44.   SEVERITY_ERROR = 1;
  45.  
  46. { -------------------------- Facility definitions -------------------------}
  47.  
  48.   { generally useful errors ([SE]_*)}
  49.   FACILITY_NULL = 0;
  50.  
  51.   { remote procedure call errors (RPC_E_*)}
  52.   FACILITY_RPC = 1;
  53.  
  54.   { late binding dispatch errors}
  55.   FACILITY_DISPATCH = 2;
  56.  
  57.   { storage errors (STG_E_*)}
  58.   FACILITY_STORAGE = 3;
  59.  
  60.   { interface-specific errors}
  61.   FACILITY_ITF = 4;
  62.  
  63.   S_OK = 0;
  64.   S_FALSE =  (SEVERITY_SUCCESS shl 31) or (FACILITY_NULL shl 16) or (1);
  65.  
  66. { --------------------- FACILITY_NULL errors ------------------------------}
  67.  
  68.   { relatively catastrophic failure}
  69.   E_UNEXPECTED = (SEVERITY_ERROR shl 31) or (FACILITY_NULL shl 16) or ($ffff);
  70.  
  71.   { not implemented}
  72.   E_NOTIMPL = (SEVERITY_ERROR shl 31) or (FACILITY_NULL shl 16) or (1);
  73.  
  74.   { ran out of memory}
  75.   E_OUTOFMEMORY = (SEVERITY_ERROR shl 31) or (FACILITY_NULL shl 16) or (2);
  76.  
  77.   { one or more arguments are invalid}
  78.   E_INVALIDARG = (SEVERITY_ERROR shl 31) or (FACILITY_NULL shl 16) or (3);
  79.  
  80.   { no such interface supported}
  81.   E_NOINTERFACE = (SEVERITY_ERROR shl 31) or (FACILITY_NULL shl 16) or (4);
  82.  
  83.   { invalid pointer}
  84.   E_POINTER = (SEVERITY_ERROR shl 31) or (FACILITY_NULL shl 16) or (5);
  85.  
  86.   { invalid handle}
  87.   E_HANDLE = (SEVERITY_ERROR shl 31) or (FACILITY_NULL shl 16) or (6);
  88.  
  89.   { operation aborted}
  90.   E_ABORT = (SEVERITY_ERROR shl 31) or (FACILITY_NULL shl 16) or (7);
  91.  
  92.   { unspecified error}
  93.   E_FAIL = (SEVERITY_ERROR shl 31) or (FACILITY_NULL shl 16) or (8);
  94.  
  95.   { general access denied error}
  96.   E_ACCESSDENIED = (SEVERITY_ERROR shl 31) or (FACILITY_NULL shl 16) or (9);
  97.  
  98.  
  99. { ----------------- FACILITY_ITF errors used by OLE ---------------------}
  100.  
  101. { By convention, OLE interfaces divide the FACILITY_ITF range of errors
  102.   into nonoverlapping subranges.  If an OLE interface returns a FACILITY_ITF
  103.   scode, it must be from the range associated with that interface or from
  104.   the shared range: OLE_E_FIRST...OLE_E_LAST.
  105.  
  106.   The ranges, their associated interfaces, and the header file that defines
  107.   the actual scodes are given below. }
  108.  
  109.   { Generic OLE errors that may be returned by many interfaces}
  110.   OLE_E_FIRST = (SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or ($0000);
  111.   OLE_E_LAST = (SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or ($00FF);
  112.   OLE_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($0000);
  113.   OLE_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($00FF);
  114.  
  115.   { interfaces: all}
  116.   DRAGDROP_E_FIRST = (SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or ($0100);
  117.   DRAGDROP_E_LAST = (SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or ($010F);
  118.   DRAGDROP_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($0100);
  119.   DRAGDROP_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($010F);
  120.  
  121.   { interfaces: IDropSource, IDropTarget}
  122.   CLASSFACTORY_E_FIRST = (SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or ($0110);
  123.   CLASSFACTORY_E_LAST = (SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or ($011F);
  124.   CLASSFACTORY_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($0110);
  125.   CLASSFACTORY_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($011F);
  126.  
  127.   { interfaces: IClassFactory}
  128.   MARSHAL_E_FIRST = (SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or ($0120);
  129.   MARSHAL_E_LAST = (SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or ($012F);
  130.   MARSHAL_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($0120);
  131.   MARSHAL_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($012F);
  132.  
  133.   { interfaces: IMarshal, IStdMarshalInfo, marshal APIs}
  134.   DATA_E_FIRST = (SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or ($0130);
  135.   DATA_E_LAST = (SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or ($013F);
  136.   DATA_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($0130);
  137.   DATA_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($013F);
  138.  
  139.   { interfaces: IDataObject}
  140.   VIEW_E_FIRST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($0140);
  141.   VIEW_E_LAST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($014F);
  142.   VIEW_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($0140);
  143.   VIEW_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($014F);
  144.  
  145.   { interfaces: IViewObject}
  146.   REGDB_E_FIRST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($0150);
  147.   REGDB_E_LAST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($015F);
  148.   REGDB_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($0150);
  149.   REGDB_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($015F);
  150.  
  151.   { API: reg.dat manipulation}
  152.   { range 160 - 16F reserved}
  153.   CACHE_E_FIRST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($0170);
  154.   CACHE_E_LAST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($017F);
  155.   CACHE_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($0170);
  156.   CACHE_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($017F);
  157.  
  158.   { interfaces: IOleCache}
  159.   OLEOBJ_E_FIRST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($0180);
  160.   OLEOBJ_E_LAST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($018F);
  161.   OLEOBJ_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($0180);
  162.   OLEOBJ_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($018F);
  163.  
  164.   { interfaces: IOleObject}
  165.   CLIENTSITE_E_FIRST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($0190);
  166.   CLIENTSITE_E_LAST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($019F);
  167.   CLIENTSITE_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($0190);
  168.   CLIENTSITE_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($019F);
  169.  
  170.   { interfaces: IOleClientSite}
  171.   INPLACE_E_FIRST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($01A0);
  172.   INPLACE_E_LAST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($01AF);
  173.   INPLACE_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($01A0);
  174.   INPLACE_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($01AF);
  175.  
  176.   { interfaces: IOleWindow, IOleInPlaceObject, IOleInPlaceActiveObject,}
  177.   {             IOleInPlaceUIWindow, IOleInPlaceFrame, IOleInPlaceSite}
  178.   ENUM_E_FIRST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($01B0);
  179.   ENUM_E_LAST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($01BF);
  180.   ENUM_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($01B0);
  181.   ENUM_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($01BF);
  182.  
  183.   { interfaces: IEnum*}
  184.   CONVERT10_E_FIRST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($01C0);
  185.   CONVERT10_E_LAST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($01CF);
  186.   CONVERT10_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($01C0);
  187.   CONVERT10_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($01CF);
  188.  
  189.   { API: OleConvertOLESTREAMToIStorage, OleConvertIStorageToOLESTREAM}
  190.   CLIPBRD_E_FIRST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($01D0);
  191.   CLIPBRD_E_LAST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($01DF);
  192.   CLIPBRD_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($01D0);
  193.   CLIPBRD_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($01DF);
  194.  
  195.   { interfaces: OleSetClipboard, OleGetClipboard, OleFlushClipboard}
  196.   MK_E_FIRST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($01E0);
  197.   MK_E_LAST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($01EF);
  198.   MK_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($01E0);
  199.   MK_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($01EF);
  200.  
  201.   { interfaces: IMoniker, IBindCtx, IRunningObjectTable, IParseDisplayName,}
  202.   {             IOleContainer, IOleItemContainer, IOleLink}
  203.   CO_E_FIRST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($01F0);
  204.   CO_E_LAST = (SEVERITY_ERROR shl 31) or (  FACILITY_ITF shl 16) or ($01FF);
  205.   CO_S_FIRST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($01F0);
  206.   CO_S_LAST = (SEVERITY_SUCCESS shl 31) or (FACILITY_ITF shl 16) or ($01FF);
  207.  
  208.  
  209. { *********************** Compobj errors **********************************}
  210.  
  211.   { CoInitialize has not been called and must be}
  212.   CO_E_NOTINITIALIZED = (CO_E_FIRST + $0);
  213.  
  214.   { CoInitialize has already been called and cannot be called again (temporary)}
  215.   CO_E_ALREADYINITIALIZED = (CO_E_FIRST + $1);
  216.  
  217.   { can't determine clsid (e.g., extension not in reg.dat)}
  218.   CO_E_CANTDETERMINECLASS = (CO_E_FIRST + $2);
  219.  
  220.   { the string form of the clsid is invalid (including ole1 classes)}
  221.   CO_E_CLASSSTRING = (CO_E_FIRST + $3);
  222.  
  223.   { the string form of the iid is invalid}
  224.   CO_E_IIDSTRING = (CO_E_FIRST + $4);
  225.  
  226.   { application not found}
  227.   CO_E_APPNOTFOUND = (CO_E_FIRST + $5);
  228.  
  229.   { application cannot be run more than once}
  230.   CO_E_APPSINGLEUSE = (CO_E_FIRST + $6);
  231.  
  232.   { some error in the app program file}
  233.   CO_E_ERRORINAPP = (CO_E_FIRST + $7);
  234.  
  235.   { dll not found}
  236.   CO_E_DLLNOTFOUND = (CO_E_FIRST + $8);
  237.  
  238.   { some error in the dll file}
  239.   CO_E_ERRORINDLL = (CO_E_FIRST + $9);
  240.  
  241.   { app written for other version of OS or other OS altogether}
  242.   CO_E_WRONGOSFORAPP = (CO_E_FIRST + $a);
  243.  
  244.   { object is not registered}
  245.   CO_E_OBJNOTREG = (CO_E_FIRST + $b);
  246.  
  247.   { object is already registered}
  248.   CO_E_OBJISREG = (CO_E_FIRST + $c);
  249.  
  250.   { handler is not connected to server}
  251.   CO_E_OBJNOTCONNECTED = (CO_E_FIRST + $d);
  252.  
  253.   { app was launched, but didn't registered a class factory}
  254.   CO_E_APPDIDNTREG = (CO_E_FIRST + $e);
  255.  
  256.  
  257. { ********************* ClassObject errors ********************************}
  258.  
  259.   { class does not support aggregation (or class object is remote)}
  260.   CLASS_E_NOAGGREGATION = (CLASSFACTORY_E_FIRST + $0);
  261.  
  262.   { dll doesn't support that class (returned from DllGetClassObject)}
  263.   CLASS_E_CLASSNOTAVAILABLE = (CLASSFACTORY_E_FIRST + $1);
  264.  
  265.  
  266. { *********************** Reg.dat errors **********************************}
  267.  
  268.   { some error reading the registration database }
  269.   REGDB_E_READREGDB = (REGDB_E_FIRST + $0);
  270.  
  271.   { some error reading the registration database }
  272.   REGDB_E_WRITEREGDB = (REGDB_E_FIRST + $1);
  273.  
  274.   { some error reading the registration database }
  275.   REGDB_E_KEYMISSING = (REGDB_E_FIRST + $2);
  276.  
  277.   { some error reading the registration database }
  278.   REGDB_E_INVALIDVALUE = (REGDB_E_FIRST + $3);
  279.  
  280.   { some error reading the registration database }
  281.   REGDB_E_CLASSNOTREG = (REGDB_E_FIRST + $4);
  282.  
  283.   { some error reading the registration database }
  284.   REGDB_E_IIDNOTREG = (REGDB_E_FIRST + $5);
  285.  
  286.  
  287. { Other value types }
  288.  
  289.   { these are mostly for internal use...}
  290.   MEMCTX_SAME = $FFFFFFFE;       { same context (as some other pointer)}
  291.   MEMCTX_UNKNOWN = $FFFFFFFF;    { unknown context (when asked about it)}
  292.   MEMCTX_SHARED = 2;             { shared memory (between processes)}
  293.   MEMCTX_TASK = 1;               { task (private) memory}
  294.  
  295.   { class context: used to determine what scope and kind of class object to use}
  296.   CLSCTX_LOCAL_SERVER = 4;       { server exe (runs on same machine; diff proc)}
  297.   CLSCTX_INPROC_HANDLER = 2;     { handler dll (runs in same process as caller)}
  298.   CLSCTX_INPROC_SERVER = 1;      { server dll (runs in same process as caller)}
  299.  
  300.   { minimum number of bytes for interface marshl}
  301.   MARSHALINTERFACE_MIN = 40;
  302.  
  303.   { verbs }
  304.   DVASPECT_DOCPRINT = 8;
  305.   DVASPECT_ICON = 4;
  306.   DVASPECT_THUMBNAIL = 2;
  307.   DVASPECT_CONTENT = 1;
  308.  
  309.   { TYpes of storage MEDiums; determines how data is stored or passed around}
  310.   TYMED_NULL = 0;
  311.   TYMED_MFPICT = $20;
  312.   TYMED_GDI = $10;
  313.   TYMED_ISTORAGE = 8;
  314.   TYMED_ISTREAM = 4;
  315.   TYMED_FILE = 2;
  316.   TYMED_HGLOBAL = 1;
  317.  
  318.   { Advise Flags}
  319.   ADVFCACHE_ONSAVE = $20;
  320.   ADVFCACHE_FORCEBUILTIN = $10;
  321.   ADVFCACHE_NOHANDLER = 8;
  322.   ADVF_DATAONSTOP = $40;
  323.   ADVF_ONLYONCE = 4;
  324.   ADVF_PRIMEFIRST = 2;
  325.   ADVF_NODATA = 1;
  326.  
  327.   { for OleCreateEmbeddingHelper flags; roles in low word; options in high word}
  328.  
  329.   { role is handler; implementation is }
  330.   EMBDHLP_INPROC_HANDLER = 0;
  331.   { default handler; pCF can be NULL}
  332.  
  333.   { role is server; pCF can't be NULL}
  334.   EMBDHLP_INPROC_SERVER = 1;
  335.  
  336.   { create using pCF immediately; if pCF}
  337.   EMBDHLP_CREATENOW = 0;
  338.   { is NULL, uses std remoting handler}
  339.  
  340.   { delayed create; must supply pCF}
  341.   EMBDHLP_DELAYCREATE = $10000;
  342.  
  343.   { Cache update Flags}
  344.   UPDFCACHE_NODATACACHE = 1;
  345.   UPDFCACHE_ONSAVECACHE = 2;
  346.   UPDFCACHE_ONSTOPCACHE = 4;
  347.   UPDFCACHE_NORMALCACHE = 8;
  348.   UPDFCACHE_IFBLANK = $10;
  349.   UPDFCACHE_ONLYIFBLANK = $80000000;
  350.  
  351.   { Storage types }
  352.   CWCSTORAGENAME = $20;
  353.  
  354.   { Storage instantiation modes }
  355.   STGM_DIRECT = 0;
  356.   STGM_TRANSACTED = $10000;
  357.   STGM_READ = 0;
  358.   STGM_WRITE = 1;
  359.   STGM_READWRITE = 2;
  360.   STGM_SHARE_DENY_NONE = $40;
  361.   STGM_SHARE_DENY_READ = 48;
  362.   STGM_SHARE_DENY_WRITE = $20;
  363.   STGM_SHARE_EXCLUSIVE = $10;
  364.   STGM_PRIORITY = $40000;
  365.   STGM_DELETEONRELEASE = $4000000;
  366.   STGM_CREATE = $1000;
  367.   STGM_CONVERT = $20000;
  368.   STGM_FAILIFTHERE = 0;
  369.  
  370.  
  371.   { Storage Error Codes }
  372.   STG_E_INVALIDFUNCTION = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or (1);
  373.   STG_E_FILENOTFOUND = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or (2);
  374.   STG_E_PATHNOTFOUND = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or (3);
  375.   STG_E_TOOMANYOPENFILES = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or (4);
  376.   STG_E_ACCESSDENIED = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or (5);
  377.   STG_E_INVALIDHANDLE = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or (6);
  378.   STG_E_INSUFFICIENTMEMORY = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or (8);
  379.   STG_E_INVALIDPOINTER = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or (9);
  380.   STG_E_NOMOREFILES = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($12);
  381.   STG_E_DISKISWRITEPROTECTED = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($13);
  382.   STG_E_SEEKERROR = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($19);
  383.   STG_E_WRITEFAULT = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($1d);
  384.   STG_E_READFAULT = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($1e);
  385.   STG_E_SHAREVIOLATION = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($20);
  386.   STG_E_LOCKVIOLATION = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($21);
  387.   STG_E_FILEALREADYEXISTS = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($50);
  388.   STG_E_INVALIDPARAMETER = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($57);
  389.   STG_E_MEDIUMFULL = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($70);
  390.   STG_E_ABNORMALAPIEXIT = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($fa);
  391.   STG_E_INVALIDHEADER = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($fb);
  392.   STG_E_INVALIDNAME = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($fc);
  393.   STG_E_UNKNOWN = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($fd);
  394.   STG_E_UNIMPLEMENTEDFUNCTION = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($fe);
  395.   STG_E_INVALIDFLAG = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($ff);
  396.  
  397.   { Standard storage error codes }
  398.   STG_E_INUSE = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($100);
  399.   STG_E_NOTCURRENT = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($101);
  400.   STG_E_REVERTED = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($102);
  401.   STG_E_CANTSAVE = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($103);
  402.   STG_E_OLDFORMAT = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($104);
  403.   STG_E_OLDDLL = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($105);
  404.   STG_E_SHAREREQUIRED = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($106);
  405.   STG_E_NOTFILEBASEDSTORAGE = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($107);
  406.   STG_E_EXTANTMARSHALLINGS = (SEVERITY_ERROR shl 31) or (FACILITY_STORAGE shl 16) or ($108);
  407.   STG_S_CONVERTED = (SEVERITY_SUCCESS shl 31) or (FACILITY_STORAGE shl 16) or ($200);
  408.  
  409.   { IDrop??? Interfaces }
  410.   MK_ALT = $20;
  411.  
  412.   DROPEFFECT_NONE = 0;
  413.   DROPEFFECT_COPY = 1;
  414.   DROPEFFECT_MOVE = 2;
  415.   DROPEFFECT_LINK = 4;
  416.   DROPEFFECT_SCROLL = $80000000;
  417.  
  418.   { default inset-width of the hot zone, in pixels}
  419.   {   typical use: GetProfileInt("windows","DragScrollInset",DD_DEFSCROLLINSET)}
  420.   DD_DEFSCROLLINSET = 11;
  421.  
  422.   { default delay before scrolling, in milliseconds}
  423.   {   typical use: GetProfileInt("windows","DragScrollDelay",DD_DEFSCROLLDELAY)}
  424.   DD_DEFSCROLLDELAY = 50;
  425.  
  426.   { default scroll interval, in milliseconds}
  427.   {   typical use: GetProfileInt("windows","DragScrollInterval", DD_DEFSCROLLINTERVAL) }
  428.   DD_DEFSCROLLINTERVAL = 50;
  429.  
  430.   { default delay before dragging should start, in milliseconds}
  431.   {   typical use: GetProfileInt("windows", "DragDelay", DD_DEFDRAGDELAY)}
  432.   DD_DEFDRAGDELAY = 200;
  433.  
  434.   { default minimum distance (radius) before dragging should start, in pixels}
  435.   {   typical use: GetProfileInt("windows", "DragMinDist", DD_DEFDRAGMINDIST)}
  436.   DD_DEFDRAGMINDIST = 2;
  437.  
  438.   { Dragdrop specific error codes }
  439.  
  440.   { trying to revoke a drop target that has not been registered }
  441.   DRAGDROP_E_NOTREGISTERED = DRAGDROP_E_FIRST;
  442.  
  443.   { this window has already been registered as a drop target}
  444.   DRAGDROP_E_ALREADYREGISTERED = DRAGDROP_E_FIRST + 1;
  445.  
  446.   { invalid HWND}
  447.   DRAGDROP_E_INVALIDHWND = DRAGDROP_E_FIRST + 2;
  448.  
  449.   { successful drop took place }
  450.   DRAGDROP_S_DROP = DRAGDROP_S_FIRST + 0;
  451.  
  452.   { drag-drop operation canceled}
  453.   DRAGDROP_S_CANCEL = DRAGDROP_S_FIRST + 1;
  454.  
  455.   { use the default cursor}
  456.   DRAGDROP_S_USEDEFAULTCURSORS = DRAGDROP_S_FIRST + 2;
  457.  
  458.   { bind flags; controls binding; stored in bind options above}
  459.   BIND_JUSTTESTEXISTENCE = 2;
  460.   BIND_MAYBOTHERUSER = 1;
  461.  
  462.   { system moniker types; returned from IsSystemMoniker.}
  463.   MKSYS_POINTERMONIKER = 5;
  464.   MKSYS_ITEMMONIKER = 4;
  465.   MKSYS_ANTIMONIKER = 3;
  466.   MKSYS_FILEMONIKER = 2;
  467.   MKSYS_GENERICCOMPOSITE = 1;
  468.   MKSYS_NONE = 0;
  469.  
  470.   { bit wise enum to control how much reduction takes place.}
  471.   MKRREDUCE_ALL = 0;
  472.   MKRREDUCE_THROUGHUSER = $10000;
  473.   MKRREDUCE_TOUSER = $20000;
  474.   MKRREDUCE_ONE = $30000;
  475.  
  476.   { IRunningObjectTable::Register flags }
  477.   ROTFLAGS_REGISTRATIONKEEPSALIVE = 1;
  478.  
  479.   OLECONTF_ONLYIFRUNNING = $10;
  480.   OLECONTF_ONLYUSER = 8;
  481.   OLECONTF_OTHERS = 4;
  482.   OLECONTF_LINKS = 2;
  483.   OLECONTF_EMBEDDINGS = 1;
  484.  
  485.   {misc definitions}
  486.   INPLACE_DEFBORDERWIDTH = 4;
  487.  
  488.   { bits returned from IOleObject::GetMistStatus}
  489.   { bitwise}
  490.   OLEMISC_RENDERINGISDEVICEINDEPEN = $200;
  491.   OLEMISC_ACTIVATEWHENVISIBLE = $100;
  492.   OLEMISC_INSIDEOUT = $80;
  493.   OLEMISC_ISLINKOBJECT = $40;
  494.   OLEMISC_CANLINKBYOLE1 = $20;
  495.   OLEMISC_CANTLINKINSIDE = $10;
  496.   OLEMISC_STATIC = 8;
  497.   OLEMISC_INSERTNOTREPLACE = 4;
  498.   OLEMISC_ONLYICONIC = 2;
  499.   OLEMISC_RECOMPOSEONRESIZE = 1;
  500.  
  501. {*************** FACILITY_ITF scodes common to all interfaces ************}
  502.  
  503. { By convention, OLE interfaces divide the FACILITY_ITF range of errors
  504.   into nonoverlapping subranges.  If an interface returns a FACILITY_ITF
  505.   scode, it must be from the range associated with that interface or from
  506.   the shared range: OLE_E_FIRST...OLE_E_LAST. }
  507.  
  508. { error codes }
  509.  
  510.   { invalid OLEVERB structure  }
  511.   OLE_E_OLEVERB = OLE_E_FIRST;
  512.  
  513.   { invalid advise flags}
  514.   OLE_E_ADVF = OLE_E_FIRST + 1;
  515.  
  516.   { you can't enuemrate any more, because the associated data is missing}
  517.   OLE_E_ENUM_NOMORE = OLE_E_FIRST + 2;
  518.  
  519.   { this implementation doesn't take advises}
  520.   OLE_E_ADVISENOTSUPPORTED = OLE_E_FIRST + 3;
  521.  
  522.   { there is no connection for this connection id}
  523.   OLE_E_NOCONNECTION = OLE_E_FIRST + 4;
  524.  
  525.   { need run the object to perform this operation}
  526.   OLE_E_NOTRUNNING = OLE_E_FIRST + 5;
  527.  
  528.   { there is no cache to operate on}
  529.   OLE_E_NOCACHE = OLE_E_FIRST + 6;
  530.  
  531.   { Uninitialized object}
  532.   OLE_E_BLANK = OLE_E_FIRST + 7;
  533.  
  534.   { linked object's source class has changed }
  535.   OLE_E_CLASSDIFF = OLE_E_FIRST + 8;
  536.  
  537.   { not able to get the moniker of the object}
  538.   OLE_E_CANT_GETMONIKER = OLE_E_FIRST + 9;
  539.  
  540.   { not able to bind to the source}
  541.   OLE_E_CANT_BINDTOSOURCE = OLE_E_FIRST + 10;
  542.  
  543.   { object is static, operation not allowed}
  544.   OLE_E_STATIC = OLE_E_FIRST + 11;
  545.  
  546.   { user cancelled out of save dialog}
  547.   OLE_E_PROMPTSAVECANCELLED = OLE_E_FIRST + 12;
  548.  
  549.   { invalid rectangle }
  550.   OLE_E_INVALIDRECT = OLE_E_FIRST + 13;
  551.  
  552.   { compobj.dll is too old for the ole2.dll initialized}
  553.   OLE_E_WRONGCOMPOBJ = OLE_E_FIRST + 14;
  554.  
  555.   { invalid window handle}
  556.   OLE_E_INVALIDHWND = OLE_E_FIRST + 15;
  557.  
  558.   { object is not in any of the inplace active states  }
  559.   OLE_E_NOT_INPLACEACTIVE = OLE_E_FIRST + 16;
  560.  
  561.   { not able to convert the object }
  562.   OLE_E_CANTCONVERT = OLE_E_FIRST + 17;
  563.  
  564.   { not able to perform the operation because object is not given storage yet.}
  565.   OLE_E_NOSTORAGE = OLE_E_FIRST + 18;
  566.  
  567.   DVGEN_E_FIRST = OLE_E_FIRST + 100;
  568.  
  569.   { invalid FORMATETC structure}
  570.   DV_E_FORMATETC = DVGEN_E_FIRST;
  571.  
  572.   { invalid DVTARGETDEVICE structure}
  573.   DV_E_DVTARGETDEVICE = DVGEN_E_FIRST + 1;
  574.  
  575.   { invalid STDGMEDIUM structure}
  576.   DV_E_STGMEDIUM = DVGEN_E_FIRST + 2;
  577.  
  578.   { invalid STATDATA structure}
  579.   DV_E_STATDATA = DVGEN_E_FIRST + 3;
  580.  
  581.   { invalid lindex}
  582.   DV_E_LINDEX = DVGEN_E_FIRST + 4;
  583.  
  584.   { invalid tymed}
  585.   DV_E_TYMED = DVGEN_E_FIRST + 5;
  586.  
  587.   { invalid clipboard format}
  588.   DV_E_CLIPFORMAT = DVGEN_E_FIRST + 6;
  589.  
  590.   { invalid aspect(s) }
  591.   DV_E_DVASPECT = DVGEN_E_FIRST + 7;
  592.  
  593.   { tdSize paramter of the DVTARGETDEVICE structure is invalid}
  594.   DV_E_DVTARGETDEVICE_SIZE = DVGEN_E_FIRST + 8;
  595.  
  596.   { object doesn't support IViewObject interface}
  597.   DV_E_NOIVIEWOBJECT = DVGEN_E_FIRST + 9;
  598.  
  599.  
  600. { Success codes}
  601.  
  602.   { use the reg database to provide the requested info}
  603.   OLE_S_USEREG = OLE_S_FIRST;
  604.  
  605.   { success, but static }
  606.   OLE_S_STATIC = OLE_S_FIRST + 1;
  607.  
  608.   { macintosh clipboard format}
  609.   OLE_S_MAC_CLIPFORMAT = OLE_S_FIRST + 2;
  610.  
  611. {*************************** Interface or API specific scodes *************}
  612.  
  613.   { Errors for OleConvertOLESTREAMToIStorage and OleConvertIStorageToOLESTREAM}
  614.   { OLESTREAM Get method failed}
  615.   CONVERT10_E_OLESTREAM_GET = CONVERT10_E_FIRST + 0;
  616.  
  617.   { OLESTREAM Put method failed}
  618.   CONVERT10_E_OLESTREAM_PUT = CONVERT10_E_FIRST + 1;
  619.  
  620.   { Contents of the OLESTREAM not in correct format}
  621.   CONVERT10_E_OLESTREAM_FMT = CONVERT10_E_FIRST + 2;
  622.  
  623.   { There was in an error in a Windows GDI call while converting the bitmap
  624.   to a DIB. }
  625.   CONVERT10_E_OLESTREAM_BITMAP_TO_DIB = CONVERT10_E_FIRST + 3;
  626.  
  627.   { Contents of the IStorage not in correct format}
  628.   CONVERT10_E_STG_FMT = CONVERT10_E_FIRST + 4;
  629.  
  630.   { Contents of IStorage is missing one of the standard streams ("\1CompObj",
  631.   "\1Ole", "\2OlePres000").  This may be the storage for a DLL object, or a
  632.   class that does not use the def handler. }
  633.   CONVERT10_E_STG_NO_STD_STREAM = CONVERT10_E_FIRST + 5;
  634.  
  635.   { There was in an error in a Windows GDI call while converting the DIB
  636.   to a bitmap. }
  637.   CONVERT10_E_STG_DIB_TO_BITMAP = CONVERT10_E_FIRST + 6;
  638.  
  639.   { Returned by either API, this scode indicates that the original object
  640.   had no presentation, therefore the converted object does not either. }
  641.   CONVERT10_S_NO_PRESENTATION = CONVERT10_S_FIRST + 0;
  642.  
  643.   { OpenClipboard Failed}
  644.   CLIPBRD_E_CANT_OPEN = CLIPBRD_E_FIRST + 0;
  645.  
  646.   { EmptyClipboard Failed}
  647.   CLIPBRD_E_CANT_EMPTY = CLIPBRD_E_FIRST + 1;
  648.  
  649.   { SetClipboard Failed}
  650.   CLIPBRD_E_CANT_SET = CLIPBRD_E_FIRST + 2;
  651.  
  652.   { Data on clipboard is invalid}
  653.   CLIPBRD_E_BAD_DATA = CLIPBRD_E_FIRST + 3;
  654.  
  655.   { CloseClipboard Failed}
  656.   CLIPBRD_E_CANT_CLOSE = CLIPBRD_E_FIRST + 4;
  657.  
  658.  
  659.   { Advise Flags}
  660.   DATA_E_FORMATETC = DV_E_FORMATETC;
  661.   DATA_S_SAMEFORMATETC = DATA_S_FIRST + 0;
  662.   VIEW_E_DRAW = VIEW_E_FIRST;
  663.   E_DRAW = VIEW_E_DRAW;
  664.  
  665.   VIEW_S_ALREADY_FROZEN = VIEW_S_FIRST;
  666.   CACHE_E_NOCACHE_UPDATED = CACHE_E_FIRST;
  667.   CACHE_S_FORMATETC_NOTSUPPORTED = CACHE_S_FIRST;
  668.   CACHE_S_SAMECACHE = CACHE_S_FIRST+1;
  669.   CACHE_S_SOMECACHES_NOTUPDATED = CACHE_S_FIRST+2;
  670.  
  671.   { Cache update Flags}
  672.   UPDFCACHE_IFBLANKORONSAVECACHE = (UPDFCACHE_IFBLANK) or (UPDFCACHE_ONSAVECACHE);
  673.   UPDFCACHE_ALL = (not UPDFCACHE_ONLYIFBLANK);
  674.   UPDFCACHE_ALLBUTNODATACACHE = (UPDFCACHE_ALL) and  (not UPDFCACHE_NODATACACHE);
  675.  
  676.   {Moniker consts}
  677.   MK_E_CONNECTMANUALLY = MK_E_FIRST;
  678.   MK_E_EXCEEDEDDEADLINE = MK_E_FIRST + 1;
  679.   MK_E_NEEDGENERIC = MK_E_FIRST + 2;
  680.   MK_E_UNAVAILABLE = MK_E_FIRST + 3;
  681.   MK_E_SYNTAX = MK_E_FIRST + 4;
  682.   MK_E_NOOBJECT = MK_E_FIRST + 5;
  683.   MK_E_INVALIDEXTENSION = MK_E_FIRST + 6;
  684.   MK_E_INTERMEDIATEINTERFACENOTSUPPORTED = MK_E_FIRST + 7;
  685.   MK_E_NOTBINDABLE = MK_E_FIRST + 8;
  686.  
  687.   { called IBindCtx->RevokeObjectBound for an object which was not bound }
  688.   MK_E_NOTBOUND = MK_E_FIRST + 9;
  689.  
  690.   MK_E_CANTOPENFILE = MK_E_FIRST + 10;
  691.   MK_E_MUSTBOTHERUSER = MK_E_FIRST + 11;
  692.   MK_E_NOINVERSE = MK_E_FIRST + 12;
  693.   MK_E_NOSTORAGE = MK_E_FIRST + 13;
  694.   MK_E_NOPREFIX = MK_E_FIRST + 14;
  695.   { reserved                     MK_S_FIRST}
  696.   { reserved                     (MK_S_FIRST + 1)}
  697.   MK_S_REDUCED_TO_SELF = MK_S_FIRST + 2;
  698.   MK_S_ME = MK_S_FIRST + 4;
  699.   MK_S_HIM = MK_S_FIRST + 5;
  700.   MK_S_US = MK_S_FIRST + 6;
  701.   MK_S_MONIKERALREADYREGISTERED = MK_S_FIRST + 7;
  702.  
  703.   OLEOBJ_E_NOVERBS = OLEOBJ_E_FIRST + 0;
  704.   OLEOBJ_E_INVALIDVERB = OLEOBJ_E_FIRST + 1;
  705.   OLEOBJ_S_INVALIDVERB = OLEOBJ_S_FIRST + 0;
  706.  
  707.   { verb number is valid but verb cannot be done now, for instance
  708.     hiding a link or hiding a visible OLE 1.0 server }
  709.   OLEOBJ_S_CANNOT_DOVERB_NOW = OLEOBJ_S_FIRST + 1;
  710.  
  711.   OLEOBJ_S_INVALIDHWND = OLEOBJ_S_FIRST + 2; { invalid hwnd passed}
  712.  
  713.   { Inplace editing specific error codes }
  714.   INPLACE_E_NOTUNDOABLE = INPLACE_E_FIRST; { undo is not avaiable}
  715.   INPLACE_E_NOTOOLSPACE = INPLACE_E_FIRST+1; { Space for tools is not available}
  716.   { Message is too long, some of it had to be truncated before displaying}
  717.   INPLACE_S_TRUNCATED = INPLACE_S_FIRST;
  718.  
  719. { *************************** RPC errors **********************************}
  720.  
  721.   RPC_E_FIRST = (SEVERITY_ERROR shl 31) or (FACILITY_RPC shl 16) or (0);
  722.  
  723.   { call was rejected by callee, either by MF::HandleIncomingCall or }
  724.   RPC_E_CALL_REJECTED = RPC_E_FIRST + 1;
  725.  
  726.   { call was canceld by call - returned by MessagePending
  727.   this code only occurs if MessagePending return cancel }
  728.   RPC_E_CALL_CANCELED = RPC_E_FIRST + 2;
  729.  
  730.   { the caller is dispatching an intertask SendMessage call and
  731.   can NOT call out via PostMessage }
  732.   RPC_E_CANTPOST_INSENDCALL = RPC_E_FIRST + 3;
  733.  
  734.   { the caller is dispatching an asynchronus call can NOT
  735.   make an outgoing call on behalf of this call }
  736.   RPC_E_CANTCALLOUT_INASYNCCALL = RPC_E_FIRST + 4;
  737.  
  738.   { the caller is not in a state where an outgoing call can be made this
  739.   is the case if the caller has an outstandig call and another incoming
  740.   call was excepted by HIC; now the caller is not allowed to call out
  741.   again }
  742.   RPC_E_CANTCALLOUT_INEXTERNALCALL = RPC_E_FIRST + 5;
  743.  
  744.   { the connection terminated or is in a bogus state and can not be used
  745.   any more. Other connections are still valid. }
  746.   RPC_E_CONNECTION_TERMINATED = RPC_E_FIRST + 6;
  747.  
  748.   { the callee (server [not server application]) is not available
  749.   and disappeared; all connections are invalid }
  750.   RPC_E_SERVER_DIED = RPC_E_FIRST + 7;
  751.  
  752.   { the caller (client ) disappeared while the callee (server) was
  753.   processing a call }
  754.   RPC_E_CLIENT_DIED = RPC_E_FIRST + 8;
  755.  
  756.   { the date paket with the marshalled parameter data is incorrect }
  757.   RPC_E_INVALID_DATAPACKET = RPC_E_FIRST + 9;
  758.  
  759.   { the call was not transmitted properly; the message queue
  760.   was full and was not emptied after yielding }
  761.   RPC_E_CANTTRANSMIT_CALL = RPC_E_FIRST + $0A;
  762.  
  763.   { the client (caller) can not marshall the parameter data
  764.   or unmarshall the return data - low memory etc. }
  765.   RPC_E_CLIENT_CANTMARSHAL_DATA = RPC_E_FIRST + $0B;
  766.   RPC_E_CLIENT_CANTUNMARSHAL_DATA = RPC_E_FIRST + $0C;
  767.  
  768.   { the server (caller) can not unmarshall the parameter data
  769.   or marshall the return data - low memory }
  770.   RPC_E_SERVER_CANTMARSHAL_DATA = RPC_E_FIRST + $0D;
  771.   RPC_E_SERVER_CANTUNMARSHAL_DATA = RPC_E_FIRST + $0E;
  772.  
  773.   { received data are invalid; can be server or client data }
  774.   RPC_E_INVALID_DATA = RPC_E_FIRST + $0F;
  775.  
  776.   { a particular parameter is invalid and can not be un/marshalled }
  777.   RPC_E_INVALID_PARAMETER = RPC_E_FIRST + $10;
  778.  
  779.   { DDE conversation - no second outgoing call on same channel }
  780.   RPC_E_CANTCALLOUT_AGAIN = RPC_E_FIRST + $11;
  781.  
  782.   { a internal error occured }
  783.   RPC_E_UNEXPECTED = RPC_E_FIRST + $FFFF;
  784.  
  785.   CLSCTX_ALL = (CLSCTX_INPROC_SERVER) or (CLSCTX_INPROC_HANDLER) or (CLSCTX_LOCAL_SERVER);
  786.   CLSCTX_INPROC = (CLSCTX_INPROC_SERVER) or (CLSCTX_INPROC_HANDLER);
  787.   CLSCTX_SERVER = (CLSCTX_INPROC_SERVER) or (CLSCTX_LOCAL_SERVER);
  788.  
  789. type
  790.   PStr = PChar;
  791.   LPCSTR = PChar;
  792.   LPLOGPALETTE = Pointer;
  793.   LPMSG = Pointer;
  794.  
  795.   TRectLong = record
  796.     Left, Top, Right, Bottom: Longint;
  797.   end;
  798.  
  799.   TPointLong = record
  800.     x, y: Longint;
  801.   end;
  802.  
  803.   PSize = ^Size;
  804.   Size = record
  805.       cx, cy: Integer;
  806.   end;
  807.  
  808.   PSizeLong = ^SizeLong;
  809.   SizeLong = record
  810.     cx: Longint;
  811.     cy: Longint;
  812.   end;
  813.  
  814.  
  815. { Status values are 32 bit values layed out as follows:
  816.   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  817.   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
  818.  +-+---------------------+-------+-------------------------------+
  819.  |S|       Context       | Facil |               Code            |
  820.  +-+---------------------+-------+-------------------------------+
  821.  where
  822.      S - is the severity code
  823.          0 - Success
  824.          1 - Error
  825.  
  826.      Context - context info
  827.      Facility - is the facility code
  828.      Code - is the facility's status code }
  829.  
  830. function SUCCEEDED(Status: SCODE): Boolean;
  831. function FAILED(Status: SCODE): Boolean;
  832. function SUCCEEDEDHR(hr: HRESULT): Boolean;
  833. function FAILEDHR(hr: HRESULT): Boolean;
  834.  
  835. function SCODE_CODE(sc: SCode): Integer;
  836. function SCODE_FACILITY(sc: SCode): Integer;
  837. function SCODE_SEVERITY(sc: SCode): Integer;
  838.  
  839. type
  840.   { Globally Unique Ids }
  841.   GUID = record
  842.     Data1: Longint;
  843.     Data2: Word;
  844.     Data3: Word;
  845.     Data4: array[1..8] of Byte;
  846.   end;
  847.  
  848.   LPGUID = ^GUID;
  849.  
  850.   { Each dll/exe must initialize the GUIDs once.  This is done in one of
  851.   two ways.  If you are not using precompiled headers for the file(s) which
  852.   initializes the GUIDs, define INITGUID before including compobj.h.  This
  853.   is how OLE builds the initialized versions of the GUIDs which are included
  854.   in compobj.dll.
  855.  
  856.   The alternative (which some versions of the compiler don't handle properly;
  857.   they wind up with the initialized GUIDs in a data, not a text segment),
  858.   is to use a precompiled version of compobj.h and then include initguid.h
  859.   after compobj.h followed by one or more of the guid defintion files. }
  860.  
  861. {!!! #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \    EXTERN_C const GUID CDECL FAR name }
  862. {!!! #define DEFINE_OLEGUID(name, l, w1, w2) \    DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46) }
  863.  
  864.  
  865.   { Interface ID are just a kind of GUID }
  866.   IID = GUID;
  867.   LPIID = ^IID;
  868.  
  869.   { Class ID are just a kind of GUID}
  870.   CLSID = GUID;
  871.   LPCLSID = ^CLSID;
  872.   REFIID = ^IID;
  873.   REFGUID = REFIID;
  874.   REFCLSID = REFIID;
  875.  
  876.   { this file is the master definition of all GUIDs for the component object
  877.   model and is included in compobj.h.  Some GUIDs for moinkers and storage
  878.   appear here as well.  All of these GUIDs are OLE GUIDs only in the sense
  879.   that part of the GUID range owned by OLE was used to define them.
  880.  
  881.   NOTE: The second byte of all of these GUIDs is 0. }
  882.  
  883.   { These functions return copies of the globally defined IID's. It is more
  884.     efficient to use the PIID version of these functions (declared below).
  885.     These are provided for convience and compatiblity with C and C++ }
  886.  
  887. function GUID_NULL: GUID;
  888. function IID_NULL: IID;
  889. function CLSID_NULL: CLSID;
  890.  
  891. function IID_IUnknown: GUID;
  892. function IID_IClassFactory: GUID;
  893. function IID_IMalloc: GUID;
  894. function IID_IMarshal: GUID;
  895.  
  896. { RPC related interfaces }
  897. function IID_IRpcChannel: GUID;
  898. function IID_IRpcStub: GUID;
  899. function IID_IStubManager: GUID;
  900. function IID_IRpcProxy: GUID;
  901. function IID_IProxyManager: GUID;
  902. function IID_IPSFactory: GUID;
  903.  
  904. { storage related interfaces }
  905. function IID_ILockBytes: GUID;
  906. function IID_IStorage: GUID;
  907. function IID_IStream: GUID;
  908. function IID_IEnumStatStg: GUID;
  909.  
  910. { moniker related interfaces }
  911. function IID_IBindCtx: GUID;
  912. function IID_IMoniker: GUID;
  913. function IID_IRunningObjectTable: GUID;
  914. function IID_IInternalMoniker: GUID;
  915.  
  916. { storage related interfaces }
  917. function IID_IRootStorage: GUID;
  918. function IID_IDfReserved1: GUID;
  919. function IID_IDfReserved2: GUID;
  920. function IID_IDfReserved3: GUID;
  921.  
  922. { concurrency releated interfaces }
  923. function IID_IMessageFilter: GUID;
  924.  
  925. { CLSID of standard marshaler }
  926. function CLSID_StdMarshal: GUID;
  927.  
  928. { interface on server for getting info for std marshaler }
  929. function IID_IStdMarshalInfo: GUID;
  930.  
  931. { interface to inform object of number of external connections }
  932. function IID_IExternalConnection: GUID;
  933.  
  934. { These functions return points to the IID's which are found in the OLE2
  935.   DLL's.  It is more efficient to use these instead of the above functions
  936.   since they do not copy the 8 byte IID onto the stack. For example,
  937.   call IsEqualGUID using:  if IsEqualGUID(IID, PIID_IUnknown^) then }
  938.  
  939. function PGUID_NULL: REFGUID;
  940. function PIID_NULL: REFIID;
  941. function PCLSID_NULL: REFCLSID;
  942.  
  943. function PIID_IUnknown: REFGUID;
  944. function PIID_IClassFactory: REFGUID;
  945. function PIID_IMalloc: REFGUID;
  946. function PIID_IMarshal: REFGUID;
  947.  
  948. { RPC related interfaces }
  949. function PIID_IRpcChannel: REFGUID;
  950. function PIID_IRpcStub: REFGUID;
  951. function PIID_IStubManager: REFGUID;
  952. function PIID_IRpcProxy: REFGUID;
  953. function PIID_IProxyManager: REFGUID;
  954. function PIID_IPSFactory: REFGUID;
  955.  
  956. { storage related interfaces }
  957. function PIID_ILockBytes: REFGUID;
  958. function PIID_IStorage: REFGUID;
  959. function PIID_IStream: REFGUID;
  960. function PIID_IEnumStatStg: REFGUID;
  961.  
  962. { moniker related interfaces }
  963. function PIID_IBindCtx: REFGUID;
  964. function PIID_IMoniker: REFGUID;
  965. function PIID_IRunningObjectTable: REFGUID;
  966. function PIID_IInternalMoniker: REFGUID;
  967.  
  968. { storage related interfaces }
  969. function PIID_IRootStorage: REFGUID;
  970. function PIID_IDfReserved1: REFGUID;
  971. function PIID_IDfReserved2: REFGUID;
  972. function PIID_IDfReserved3: REFGUID;
  973.  
  974. { concurrency releated interfaces }
  975. function PIID_IMessageFilter: REFGUID;
  976.  
  977. { CLSID of standard marshaler }
  978. function PCLSID_StdMarshal: REFGUID;
  979.  
  980. { interface on server for getting info for std marshaler }
  981. function PIID_IStdMarshalInfo: REFGUID;
  982.  
  983. { interface to inform object of number of external connections }
  984. function PIID_IExternalConnection: REFGUID;
  985.  
  986.   { class registration flags; passed to CoRegisterClassObject
  987.   class object only generates one instance same class object genereates
  988.   multiple inst.  and local automatically goes into inproc tbl.
  989.   multiple use, but separate control over each context. }
  990.  
  991. const
  992.   REGCLS_SINGLEUSER = 0;      { class object only generates one instance }
  993.   REGCLS_MULTIPLEUSE = 1;     { same class object genereates multiple inst.
  994.                                 and local automatically goes into inproc tbl. }
  995.   REGCLS_MULTI_SEPARATE = 2;  { multiple use, but separate control over each
  996.                                 context. }
  997.  
  998. { interface marshaling definitions }
  999.  
  1000. { marshaling flags; passed to CoMarshalInterface }
  1001.  
  1002.   MSHLFLAGS_NORMAL = 0;       { normal marshaling via proxy/stub}
  1003.   MSHLFLAGS_TABLESTRONG = 1;  { keep object alive; must explicitly release}
  1004.   MSHLFLAGS_TABLEWEAK = 2;    { doesn't hold object alive; still must release}
  1005.  
  1006. { marshal context: determines the destination context of the marshal operation}
  1007.  
  1008.   MSHCTX_LOCAL = 0;        { unmarshal context is local (eg.shared memory)}
  1009.   MSHCTX_NOSHAREDMEM = 1;  { unmarshal context has no shared memory access}
  1010.  
  1011. { call type used by IMessageFilter::HandleIncommingMessage}
  1012.  
  1013.   CALLTYPE_ZERO = 0;
  1014.   CALLTYPE_TOPLEVEL = 1;             { toplevel call - no outgoing call }
  1015.   CALLTYPE_NESTED = 2;               { callback on behalf of previous outgoing call - should always handle}
  1016.   CALLTYPE_ASYNC = 3;                { aysnchronous call - can NOT be rejected}
  1017.   CALLTYPE_TOPLEVEL_CALLPENDING = 4; { new toplevel call with new LID}
  1018.   CALLTYPE_ASYNC_CALLPENDING = 5;    { async call - can NOT be rejected}
  1019.  
  1020. { status of server call - returned by IMessageFilter::HandleIncommingCall
  1021.   and passed to  IMessageFilter::RetryRejectedCall }
  1022.  
  1023.   SERVERCALL_ISHANDLED = 0;
  1024.   SERVERCALL_REJECTED = 1;
  1025.   SERVERCALL_RETRYLATER = 2;
  1026.  
  1027. { Pending type indicates the level of nesting }
  1028.  
  1029.   PENDINGTYPE_TOPLEVEL = 1;  { toplevel call }
  1030.   PENDINGTYPE_NESTED = 2;    { nested call }
  1031.  
  1032. { return values of MessagePending }
  1033.  
  1034.   PENDINGMSG_CANCELCALL = 0;      { cancel the outgoing call}
  1035.   PENDINGMSG_WAITNOPROCESS = 1;   { wait for the return and don't dispatch the message}
  1036.   PENDINGMSG_WAITDEFPROCESS = 2;  { wait and dispatch the message }
  1037.  
  1038. { bit flags for IExternalConnection}
  1039.  
  1040.   EXTCONN_STRONG = 1;  { strong connection}
  1041.  
  1042. { rendering options }
  1043.  
  1044.   OLERENDER_NONE   = 0;
  1045.   OLERENDER_DRAW   = 1;
  1046.   OLERENDER_FORMAT = 2;
  1047.   OLERENDER_ASIS   = 3;
  1048.  
  1049. { OLE verb; returned by IEnumOLEVERB}
  1050.  
  1051. { Bitwise verb attributes used in OLEVERB.grfAttribs}
  1052.  
  1053.   OLEVERBATTRIB_NEVERDIRTIES = 1;
  1054.   OLEVERBATTRIB_ONCONTAINERMENU = 2;
  1055.  
  1056. { IOleObject::GetUserType optons; determines which form of the string to use}
  1057.  
  1058.   USERCLASSTYPE_FULL = 1;
  1059.   USERCLASSTYPE_SHORT = 2;
  1060.   USERCLASSTYPE_APPNAME = 3;
  1061.  
  1062.   OLECLOSE_SAVEIFDIRTY = 0;
  1063.   OLECLOSE_NOSAVE = 1;
  1064.   OLECLOSE_PROMPTSAVE = 2;
  1065.  
  1066. { IOleObject::GetMoniker and IOleClientSite::GetMoniker options; determines
  1067.   if and how monikers should be assigned. }
  1068.  
  1069.   OLEGETMONIKER_ONLYIFTHERE = 1;
  1070.   OLEGETMONIKER_FORCEASSIGN = 2;
  1071.   OLEGETMONIKER_UNASSIGN = 3;
  1072.   OLEGETMONIKER_TEMPFORUSER = 4;
  1073.  
  1074. { IOleObject::GetMoniker, IOleObject::SetMoniker and
  1075.   IOleClientSite::GetMoniker options; determines which moniker to use }
  1076.  
  1077.   OLEWHICHMK_CONTAINER = 1;
  1078.   OLEWHICHMK_OBJREL = 2;
  1079.   OLEWHICHMK_OBJFULL = 3;
  1080.  
  1081. { Storage commit types }
  1082.  
  1083.   STGC_DEFAULT = 0;
  1084.   STGC_OVERWRITE = 1;
  1085.   STGC_ONLYIFCURRENT = 2;
  1086.   STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4;
  1087.  
  1088. { Link update options }
  1089.  
  1090.   BINDSPEED_INDEFINITE = 1;
  1091.   BINDSPEED_MODERATE = 2;
  1092.   BINDSPEED_IMMEDIATE = 3;
  1093.  
  1094.   OLEUPDATE_ALWAYS = 1;
  1095.   OLEUPDATE_ONCALL = 3;
  1096.  
  1097.   OLELINKBIND_EVENIFCLASSDIFF = 1;
  1098.  
  1099. { Storage element types }
  1100.  
  1101.   STGTY_STORAGE = 1;
  1102.   STGTY_STREAM = 2;
  1103.   STGTY_LOCKBYTES = 3;
  1104.   STGTY_PROPERTY = 4;
  1105.  
  1106.   STREAM_SEEK_SET = 0;
  1107.   STREAM_SEEK_CUR = 1;
  1108.   STREAM_SEEK_END = 2;
  1109.  
  1110.   LOCK_WRITE = 1;
  1111.   LOCK_EXCLUSIVE = 2;
  1112.   LOCK_ONLYONCE = 4;
  1113.  
  1114.   STGMOVE_MOVE = 0;
  1115.   STGMOVE_COPY = 1;
  1116.  
  1117.   STATFLAG_DEFAULT = 0;
  1118.   STATFLAG_NONAME = 1;
  1119.  
  1120. { TYpes of storage MEDiums; determines how data is stored or passed around
  1121.   DATA format DIRection }
  1122.  
  1123.   DATADIR_GET = 1;
  1124.   DATADIR_SET = 2;
  1125.  
  1126.   DISCARDCACHE_SAVEIFDIRTY = 0;
  1127.   DISCARDCACHE_NOSAVE = 1;
  1128.  
  1129. { OLE 1.0 OLESTREAM declarations }
  1130.  
  1131. type
  1132.   IUnknown = class;
  1133.   PIUnknown = IUnknown;
  1134.   INTERFACEINFO = record
  1135.     pUnk: IUnknown;
  1136.     iid: IID;
  1137.     wMethod: Word;
  1138.   end;
  1139.   LPINTERFACEINFO = ^INTERFACEINFO;
  1140.  
  1141.   TFileTime = record
  1142.     dwLowDateTime, dwHighDateTime: Longint;
  1143.   end;
  1144.  
  1145. { IUnknown Interface }
  1146.  
  1147.   IUnknown = class
  1148.   public
  1149.     function QueryInterface(const iid: IID; var Obj): HResult; virtual; cdecl; export; abstract;
  1150.     function AddRef: Longint; virtual; cdecl; export; abstract;
  1151.     function Release: Longint; virtual; cdecl; export; abstract;
  1152.   end;
  1153.  
  1154. { Class Factory Interface }
  1155.  
  1156.   IClassFactory = class(IUnknown)
  1157.   public
  1158.     function CreateInstance(UnkOuter: IUnknown; const riid: IID;
  1159.       var ppvObject): HResult; virtual; cdecl; export; abstract;
  1160.     function LockServer(fLock: BOOL): HResult; virtual; cdecl; export; abstract;
  1161.   end;
  1162.  
  1163. { Memory Allocation Interface }
  1164.  
  1165.   IMalloc = class(IUnknown)
  1166.   public
  1167.     function Alloc(cb: Longint): Pointer; virtual; cdecl; export; abstract;
  1168.     function Realloc(pv: Pointer; cb: Longint): Pointer; virtual; cdecl; export; abstract;
  1169.     procedure Free(pv: Pointer); virtual; cdecl; export; abstract;
  1170.     function GetSize(pv: Pointer): Longint; virtual; cdecl; export; abstract;
  1171.     function DidAlloc(pv: Pointer): Integer; virtual; cdecl; export; abstract;
  1172.     procedure HeapMinimize; virtual; cdecl; export; abstract;
  1173.   end;
  1174.  
  1175.   IMallocSpy = class(IUnknown)
  1176.   public
  1177.     function PreAlloc(cbRequest: Longint): Longint; virtual; cdecl; export; abstract;
  1178.     function PostAlloc(pActual: Pointer): Pointer; virtual; cdecl; export; abstract;
  1179.     function PreFree(pRequest: Pointer; fSpyed: BOOL): Pointer; virtual; cdecl; export; abstract;
  1180.     procedure PostFree(fSpyed: BOOL); virtual; cdecl; export; abstract;
  1181.     function PreRealloc(pRequest: Pointer; cbRequest: Longint;
  1182.       var ppNewRequest: Pointer; fSpyed: BOOL): Longint; virtual; cdecl; export; abstract;
  1183.     function PostRealloc(pActual: Pointer; fSpyed: BOOL): Pointer; virtual; cdecl; export; abstract;
  1184.     function PreGetSize(pRequest: Pointer; fSpyed: BOOL): Pointer; virtual; cdecl; export; abstract;
  1185.     function PostGetSize(pActual: Pointer; fSpyed: BOOL): Cardinal; virtual; cdecl; export; abstract;
  1186.     function PostDidAlloc(pRequest: Pointer; fSpyed: BOOL; fActual: Integer): Integer; virtual; cdecl; export; abstract;
  1187.     procedure PreHeapMinimize; virtual; cdecl; export; abstract;
  1188.     procedure PostHeapMinimize; virtual; cdecl; export; abstract;
  1189.   end;
  1190.  
  1191. { IMarshal Interface }
  1192.  
  1193.   IStream = class;
  1194.  
  1195.   IMarshal = class(IUnknown)
  1196.   public
  1197.     function GetUnmarshalClass(const riid: IID; pv: LPVOID;
  1198.       dwDestContext: Longint; pvDestContext: LPVOID; mshlflags: Longint;
  1199.       var pCid: CLSID): HResult; virtual; cdecl; export; abstract;
  1200.     function GetMarshalSizeMax(const riid: IID; pv: LPVOID;
  1201.       dwDestContext: Longint; pvDestContext: LPVOID; mshlflags: Longint;
  1202.       var pSize: Longint): HResult; virtual; cdecl; export; abstract;
  1203.     function MarshalInterface(Stm: IStream; const riid: IID; pv: LPVOID;
  1204.       dwDestContext: Longint; pvDestContext: LPVOID; mshlflags: Longint): HResult;
  1205.       virtual; cdecl; export; abstract;
  1206.     function UnmarshalInterface(pStm: IStream; const riid: IID;
  1207.       var ppv): HResult; virtual; cdecl; export; abstract;
  1208.     function ReleaseMarshalData(pStm: IStream): HResult;
  1209.       virtual; cdecl; export; abstract;
  1210.     function DisconnectObject(dwReserved: Longint): HResult;
  1211.       virtual; cdecl; export; abstract;
  1212.   end;
  1213.  
  1214. { *** IStdMarshalInfo methods ***}
  1215.  
  1216.   IStdMarshalInfo = class(IUnknown)
  1217.     function GetClassForHandler(dwDestContext: Longint; pvDestContext: LPVOID;
  1218.       var pClsid: CLSID): HResult; virtual; cdecl; export; abstract;
  1219.   end;
  1220.  
  1221. { Message Filter Interface }
  1222.  
  1223.   IMessageFilter = class(IUnknown)
  1224.     function HandleInComingCall(dwCallType: Longint; htaskCaller: HTask;
  1225.       dwTickCount: Longint; dwReserved: Longint): Longint; virtual; cdecl; export; abstract;
  1226.     function RetryRejectedCall(htaskCallee: HTask; dwTickCount: Longint;
  1227.       dwRejectType: Longint): Longint; virtual; cdecl; export; abstract;
  1228.     function MessagePending(htaskCallee: HTask; dwTickCount: Longint;
  1229.       dwPendingType: Longint): Longint; virtual; cdecl; export; abstract;
  1230.   end;
  1231.  
  1232. { External Connection Information }
  1233.  
  1234.   IExternalConnection = class(IUnknown)
  1235.     function AddConnection(extconn: Longint; reserved: Longint): Longint;
  1236.       virtual; cdecl; export; abstract;
  1237.     function ReleaseConnection(extconn: Longint; reserved: Longint;
  1238.       fLastReleaseCloses: BOOL): Longint; virtual; cdecl; export; abstract;
  1239.   end;
  1240.  
  1241. { Enumerator Interfaces }
  1242.  
  1243.   { Since we don't use parametrized types, we put in explicit declarations
  1244.   of the enumerators we need. }
  1245.  
  1246.   IEnumString = class(IUnknown)
  1247.     function Next(celt: Longint; var rgelt: PStr;
  1248.       pceltFetched: PLongint): HResult; virtual; cdecl; export; abstract;
  1249.     function Skip(celt: Longint): HResult; virtual; cdecl; export; abstract;
  1250.     function Reset: HResult; virtual; cdecl; export; abstract;
  1251.     function Clone(var ppenm: IEnumString): HResult; virtual; cdecl; export; abstract;
  1252.   end;
  1253.  
  1254.   IEnumUnknown = class(IUnknown)
  1255.     function Next(celt: Longint; var rgelt: IUnknown;
  1256.       pceltFetched: PLongint): HResult; virtual; cdecl; export; abstract;
  1257.     function Skip(celt: Longint): HResult; virtual; cdecl; export; abstract;
  1258.     function Reset: HResult; virtual; cdecl; export; abstract;
  1259.     function Clone(var ppenm: IEnumUnknown): HResult; virtual; cdecl; export; abstract;
  1260.   end;
  1261.  
  1262.   FuncHResult = function(const p1: IID; const p2: IID; var p3: LPVOID): HResult;
  1263.  
  1264.   OLEVERB = record
  1265.     lVerb: Longint;
  1266.     lpszVerbName: PStr;
  1267.     fuFlags: Longint;
  1268.     grfAttribs: Longint;
  1269.   end;
  1270.   LPOLEVERB = ^OLEVERB;
  1271.  
  1272.   LPOLESTREAM = ^OLESTREAM;
  1273.  
  1274.   OLESTREAMVTBL = record
  1275.     Get: function (p1: LPOLESTREAM; p2: HResult; p3: Longint): Longint;
  1276.     Put: function (p1: LPOLESTREAM; p2: HResult; p3: Longint): Longint;
  1277.   end;
  1278.   LPOLESTREAMVTBL = ^OLESTREAMVTBL;
  1279.  
  1280.   OLESTREAM = record
  1281.     lpstbl: LPOLESTREAMVTBL;
  1282.   end;
  1283.  
  1284. { Clipboard Data structures }
  1285.  
  1286. { variable sized string data may appear here }
  1287.  
  1288.   OBJECTDESCRIPTOR = record
  1289.     cbSize: Longint;
  1290.     clsid: CLSID;
  1291.     dwDrawAspect: Longint;
  1292.     sizel: SizeLong;
  1293.     pointl: TPointLong;
  1294.     dwStatus: Longint;
  1295.     dwFullUserTypeName: Longint;
  1296.     dwSrcOfCopy: Longint;
  1297.   end;
  1298.  
  1299.   IAdviseSink = class;
  1300.   IStorage = class;
  1301.   IRunningObjectTable = class;
  1302.   IEnumMoniker = class;
  1303.   IOleContainer = class;
  1304.  
  1305.   CLIPFORMAT = Word;
  1306.  
  1307.   { Data/View aspect; specifies the desired aspect of the object when
  1308.   drawing or getting data. Data/View target device; determines the
  1309.   device for drawing or gettting data }
  1310.  
  1311.   DVTargetDevice = record
  1312.     tdSize: Longint;
  1313.     tdDriverNameOffset: Word;
  1314.     tdDeviceNameOffset: Word;
  1315.     tdPortNameOffset: Word;
  1316.     tdExtDevmodeOffset: Word;
  1317.     tdData: array[1..1] of Byte;
  1318.   end;
  1319.  
  1320.   { Format, etc.; completely specifices the kind of data desired, including tymed}
  1321.   PDVTargetDevice = ^DVTargetDevice;
  1322.   FORMATETC = record
  1323.     cfFormat: CLIPFORMAT;
  1324.     ptd: PDVTargetDevice;
  1325.     dwAspect: Longint;
  1326.     lindex: Longint;
  1327.     tymed: Longint;
  1328.   end;
  1329.  
  1330.   { SToraGe MEDIUM; a block of data on a particular medium }
  1331.   rec1 = record
  1332.     case Integer of
  1333.     1: (hGlobal: THandle);
  1334.     2: (lpszFileName: PStr);
  1335.     3: (pstm: IStream);
  1336.     4: (pstg: IStorage);
  1337.   end;
  1338.  
  1339.   STGMEDIUM = record
  1340.     tymed: Longint;
  1341.     u: rec1;
  1342.     pUnkForRelease: IUnknown;
  1343.   end;
  1344.  
  1345.   IMoniker = class;
  1346.  
  1347. { Advise Flags}
  1348.  
  1349.   { Stats for data; used by several enumerations and by at least one
  1350.   implementation of IDataAdviseHolder; if a field is not used, it
  1351.   will be NULL. }
  1352.  
  1353.   { field used by: EnumAdvise, EnumData (cache), EnumFormats EnumAdvise }
  1354.   STATDATA = record
  1355.     formatetc: FORMATETC;
  1356.     advf: Longint;
  1357.     pAdvSink: IAdviseSink;
  1358.     dwConnection: Longint;
  1359.   end;
  1360.  
  1361. { DV Interfaces }
  1362.  
  1363.   IEnumFORMATETC = class(IUnknown)
  1364.     function Next(celt: Longint; var rgelt: FORMATETC; pceltFetched: PLongint):
  1365.       HResult; virtual; cdecl; export; abstract;
  1366.     function Skip(celt: Longint): HResult; virtual; cdecl; export; abstract;
  1367.     function Reset: HResult; virtual; cdecl; export; abstract;
  1368.     function Clone(var ppenum: IEnumFORMATETC): HResult;
  1369.       virtual; cdecl; export; abstract;
  1370.   end;
  1371.  
  1372.   IEnumStatData = class(IUnknown)
  1373.     function Next(celt: Longint; var rgelt: STATDATA; pceltFetched: PLongint):
  1374.       HResult; virtual; cdecl; export; abstract;
  1375.     function Skip(celt: Longint): HResult; virtual; cdecl; export; abstract;
  1376.     function Reset: HResult; virtual; cdecl; export; abstract;
  1377.     function Clone(var ppenum: IEnumStatData): HResult;
  1378.       virtual; cdecl; export; abstract;
  1379.   end;
  1380.  
  1381.   IDataObject = class(IUnknown)
  1382.     function GetData(var pformatetcIn: FORMATETC; var pmedium: STGMEDIUM):
  1383.       HResult; virtual; cdecl; export; abstract;
  1384.     function GetDataHere(var pformatetc: FORMATETC; var pmedium: STGMEDIUM):
  1385.       HResult; virtual; cdecl; export; abstract;
  1386.     function QueryGetData(var pformatetc: FORMATETC): HResult;
  1387.       virtual; cdecl; export; abstract;
  1388.     function GetCanonicalFormatEtc(var pformatetc: FORMATETC;
  1389.       var pformatetcOut: FORMATETC): HResult; virtual; cdecl; export; abstract;
  1390.     function SetData(var pformatetc: FORMATETC; var pmedium: STGMEDIUM;
  1391.       fRelease: BOOL): HResult; virtual; cdecl; export; abstract;
  1392.     function EnumFormatEtc(dwDirection: Longint; var ppenumFormatEtc:
  1393.       IEnumFORMATETC): HResult; virtual; cdecl; export; abstract;
  1394.     function DAdvise(var pFormatetc: FORMATETC; advf: Longint;
  1395.       pAdvSink: IAdviseSink; var pdwConnection: Longint): HResult; virtual; cdecl; export; abstract;
  1396.     function DUnadvise(dwConnection: Longint): HResult; virtual; cdecl; export; abstract;
  1397.     function EnumDAdvise(var ppenumAdvise: IEnumStatData): HResult;
  1398.       virtual; cdecl; export; abstract;
  1399.   end;
  1400.  
  1401.   FuncBOOL = function (p1: Longint): BOOL;
  1402.  
  1403.   IViewObject = class(IUnknown)
  1404.     function Draw(dwDrawAspect: Longint; lindex: Longint; pvAspect: Pointer;
  1405.        var ptd: DVTargetDevice; hicTargetDev: HDC; hdcDraw: HDC; const lprcBounds: TRectLong;
  1406.         const lprcWBounds: TRectLong; pfnContinue: FuncBOOL; dwContinue: Longint): HResult;
  1407.         virtual; cdecl; export; abstract;
  1408.     function GetColorSet(dwDrawAspect: Longint; lindex: Longint; pvAspect: Pointer;
  1409.        var ptd: DVTargetDevice; hicTarget: HDC; var ppColorSet: LPLOGPALETTE): HResult;
  1410.         virtual; cdecl; export; abstract;
  1411.     function Freeze(dwDrawAspect: Longint; lindex: Longint; pvAspect: Pointer;
  1412.        var pdwFreeze: Longint): HResult; virtual; cdecl; export; abstract;
  1413.     function Unfreeze(dwFreeze: Longint): HResult; virtual; cdecl; export; abstract;
  1414.     function SetAdvise(aspects: Longint; advf: Longint; pAdvSink: IAdviseSink): HResult;
  1415.        virtual; cdecl; export; abstract;
  1416.     function GetAdvise(var pAspects: Longint; var pAdvf: Longint;
  1417.        var ppAdvSink: IAdviseSink): HResult; virtual; cdecl; export; abstract;
  1418.   end;
  1419.  
  1420.   IViewObject2 = class(IViewObject)
  1421.     function GetExtent(dwDrawAspect: Longint; lindex: Longint;
  1422.       var ptd: DVTargetDevice; var lpsizel: SizeLong): HResult; virtual; cdecl; export; abstract;
  1423.   end;
  1424.  
  1425.   IAdviseSink = class(IUnknown)
  1426.     procedure OnDataChange(var pFormatetc: FORMATETC; var pStgmed: STGMEDIUM);
  1427.       virtual; cdecl; export; abstract;
  1428.     procedure OnViewChange(dwAspect: Longint; lindex: Longint);
  1429.       virtual; cdecl; export; abstract;
  1430.     procedure OnRename(pmk: IMoniker); virtual; cdecl; export; abstract;
  1431.     procedure OnSave; virtual; cdecl; export; abstract;
  1432.     procedure OnClose; virtual; cdecl; export; abstract;
  1433.   end;
  1434.  
  1435.   IAdviseSink2 = class(IAdviseSink)
  1436.     procedure OnLinkSrcChange(pmk: IMoniker); virtual; cdecl; export; abstract;
  1437.   end;
  1438.  
  1439.   IDataAdviseHolder = class(IUnknown)
  1440.     function Advise(pDataObject: IDataObject; var pFetc: FORMATETC; advf: Longint;
  1441.       pAdvise: IAdviseSink; var pdwConnection: Longint): HResult; virtual; cdecl; export; abstract;
  1442.     function Unadvise(dwConnection: Longint): HResult; virtual; cdecl; export; abstract;
  1443.     function EnumAdvise(var ppenumAdvise: IEnumStatData): HResult; virtual; cdecl; export; abstract;
  1444.     function SendOnDataChange(pDataObject: IDataObject; dwReserved: Longint;
  1445.       advf: Longint): HResult; virtual; cdecl; export; abstract;
  1446.   end;
  1447.  
  1448.   IOleCache = class(IUnknown)
  1449.     function Cache(var lpFormatetc: FORMATETC; advf: Longint;
  1450.       var lpdwConnection: Longint): HResult; virtual; cdecl; export; abstract;
  1451.     function Uncache(dwConnection: Longint): HResult; virtual; cdecl; export; abstract;
  1452.     function EnumCache(var ppenumStatData: IEnumStatData): HResult;
  1453.       virtual; cdecl; export; abstract;
  1454.     function InitCache(pDataObject: IDataObject): HResult; virtual; cdecl; export; abstract;
  1455.     function SetData(var pformatetc: FORMATETC; var pmedium: STGMEDIUM;
  1456.       fRelease: BOOL): HResult; virtual; cdecl; export; abstract;
  1457.   end;
  1458.  
  1459.   IOleCache2 = class(IOleCache)
  1460.     function UpdateCache(pDataObject: IDataObject; grfUpdf: Longint;
  1461.       pReserved: LPVOID): HResult; virtual; cdecl; export; abstract;
  1462.     function DiscardCache(dwDiscardOptions: Longint): HResult; virtual; cdecl; export; abstract;
  1463.   end;
  1464.  
  1465.   IOleCacheControl = class(IUnknown)
  1466.     function OnRun(pDataObject: IDataObject): HResult; virtual; cdecl; export; abstract;
  1467.     function OnStop: HResult; virtual; cdecl; export; abstract;
  1468.   end;
  1469.  
  1470. { Storage stat buffer }
  1471.  
  1472.   TStatStg = record
  1473.     pwcsName: PChar;
  1474.     dwType: Longint;
  1475.     cbSize: ULargeint;
  1476.     MTime, CTime, ATime: TFileTime;
  1477.     grfMode: Longint;
  1478.     grfLocksSupported: Longint;
  1479.     ClsId: ClsID;
  1480.     grfStateBits: Longint;
  1481.     Reserved: Longint;
  1482.   end;
  1483.  
  1484. { Storage Enumerators }
  1485.  
  1486.   IEnumStatStg = class(IUnknown)
  1487.     function Next(celt: Longint; var rgelt: TStatStg; var pceltFetched: Longint): HResult;
  1488.       virtual; cdecl; export; abstract;
  1489.     function Skip(celt: Longint): HResult; virtual; cdecl; export; abstract;
  1490.     function Reset: HResult; virtual; cdecl; export; abstract;
  1491.     function Clone(var ppenm: IEnumStatStg): HResult; virtual; cdecl; export; abstract;
  1492.   end;
  1493.  
  1494. { ILockBytes Interface }
  1495.  
  1496.   ILockBytes = class(IUnknown)
  1497.     function ReadAt(ulOffset: Largeint; pv: Pointer; cb: Longint;
  1498.       var pcbRead: Longint): HResult; virtual; cdecl; export; abstract;
  1499.     function WriteAt(ulOffset: Largeint; const pv: Pointer; cb: Longint;
  1500.       var pcbWritten: Longint): HResult; virtual; cdecl; export; abstract;
  1501.     function Flush: HResult; virtual; cdecl; export; abstract;
  1502.     function SetSize(cb: Largeint): HResult; virtual; cdecl; export; abstract;
  1503.     function LockRegion(libOffset: Largeint; cb: Largeint;
  1504.       dwLockType: Longint): HResult; virtual; cdecl; export; abstract;
  1505.     function UnlockRegion(libOffset: Largeint; cb: Largeint;
  1506.       dwLockType: Longint): HResult; virtual; cdecl; export; abstract;
  1507.     function Stat(var pstatstg: TStatStg; grfStatFlag: Longint): HResult;
  1508.       virtual; cdecl; export; abstract;
  1509.   end;
  1510.  
  1511. { IStream Interface }
  1512.  
  1513.   IStream = class(IUnknown)
  1514.   public
  1515.     function Read(pv: Pointer; cb: Longint; var pcbRead: Longint): HResult;
  1516.       virtual; cdecl; export; abstract;
  1517.     function Write(const pv: Pointer; cb: Longint; var pcbWritten: Longint): HResult;
  1518.       virtual; cdecl; export; abstract;
  1519.     function Seek(dlibMove: Largeint; dwOrigin: Longint;
  1520.       var plibNewPosition: Largeint): HResult; virtual; cdecl; export; abstract;
  1521.     function SetSize(libNewSizeLow, libNewSizeHigh: Longint): HResult; virtual; cdecl; export; abstract;
  1522.     function CopyTo(pstm: IStream; cb: Largeint; var pcbRead: Largeint;
  1523.       var pcbWritten: Largeint): HResult; virtual; cdecl; export; abstract;
  1524.     function Commit(grfCommitFlags: Longint): HResult; virtual; cdecl; export; abstract;
  1525.     function Revert: HResult; virtual; cdecl; export; abstract;
  1526.     function LockRegion(libOffset: Largeint; cb: Largeint;
  1527.       dwLockType: Longint): HResult; virtual; cdecl; export; abstract;
  1528.     function UnlockRegion(libOffset: Largeint; cb: Largeint;
  1529.       dwLockType: Longint): HResult; virtual; cdecl; export; abstract;
  1530.     function Stat(var pstatstg: TStatStg; grfStatFlag: Longint): HResult;
  1531.       virtual; cdecl; export; abstract;
  1532.     function Clone(var ppstm: IStream): HResult; virtual; cdecl; export; abstract;
  1533.   end;
  1534.  
  1535. { IStorage Interface }
  1536.  
  1537.   IStorage = class(IUnknown)
  1538.     function CreateStream(const pwcsName: PChar; grfMode: Longint; reserved1: Longint;
  1539.       reserved2: Longint; var ppstm: IStream): HResult; virtual; cdecl; export; abstract;
  1540.     function OpenStream(const pwcsName: PChar; reserved1: Pointer; grfMode: Longint;
  1541.       reserved2: Longint; var ppstm: IStream): HResult; virtual; cdecl; export; abstract;
  1542.     function CreateStorage(const pwcsName: PChar; grfMode: Longint;
  1543.       reserved1: Longint; reserved2: Longint; var ppstg: IStorage): HResult;
  1544.       virtual; cdecl; export; abstract;
  1545.     function OpenStorage(const pwcsName: PChar; pstgPriority: IStorage;
  1546.       grfMode: Longint; var snbExclude: PStr; reserved: Longint;
  1547.       var ppstg: IStorage): HResult; virtual; cdecl; export; abstract;
  1548.     function CopyTo(ciidExclude: Longint; const rgiidExclude: IID;
  1549.       var snbExclude: PStr; pstgDest: IStorage): HResult; virtual; cdecl; export; abstract;
  1550.     function MoveElementTo(const lpszName: PChar; pstgDest: IStorage;
  1551.       const lpszNewName: PChar; grfFlags: Longint): HResult; virtual; cdecl; export; abstract;
  1552.     function Commit(grfCommitFlags: Longint): HResult; virtual; cdecl; export; abstract;
  1553.     function Revert: HResult; virtual; cdecl; export; abstract;
  1554.     function EnumElements(reserved1: Longint; reserved2: Pointer; reserved3: Longint;
  1555.       var ppenm: IEnumStatStg): HResult; virtual; cdecl; export; abstract;
  1556.     function DestroyElement(const pwcsName: PChar): HResult; virtual; cdecl; export; abstract;
  1557.     function RenameElement(const pwcsOldName: PChar;
  1558.       const pwcsNewName: PChar): HResult; virtual; cdecl; export; abstract;
  1559.     function SetElementTimes(const lpszName: PChar; const pctime: TFileTime;
  1560.       const patime: TFileTime; const pmtime: TFileTime): HResult;
  1561.       virtual; cdecl; export; abstract;
  1562.     function SetClass(const clsid: IID): HResult; virtual; cdecl; export; abstract;
  1563.     function SetStateBits(grfStateBits: Longint; grfMask: Longint): HResult;
  1564.       virtual; cdecl; export; abstract;
  1565.     function Stat(var pstatstg: TStatStg; grfStatFlag: Longint): HResult;
  1566.       virtual; cdecl; export; abstract;
  1567.   end;
  1568.  
  1569. { IRootStorage Interface }
  1570.  
  1571.   IRootStorage = class(IUnknown)
  1572.   public
  1573.     function SwitchToFile(lpstrFile: PStr): HResult; virtual; cdecl; export; abstract;
  1574.   end;
  1575.  
  1576.   IDropTarget = class(IUnknown)
  1577.     function DragEnter(pDataObj: IDataObject; grfKeyState: Longint;
  1578.       pt: TPointLong; var pdwEffect: Longint): HResult; virtual; cdecl; export; abstract;
  1579.     function DragOver(grfKeyState: Longint; pt: TPointLong;
  1580.       var pdwEffect: Longint): HResult; virtual; cdecl; export; abstract;
  1581.     function DragLeave: HResult; virtual; cdecl; export; abstract;
  1582.     function Drop(pDataObj: IDataObject; grfKeyState: Longint; pt: TPointLong;
  1583.       var pdwEffect: Longint): HResult; virtual; cdecl; export; abstract;
  1584.   end;
  1585.  
  1586.   IDropSource = class(IUnknown)
  1587.     function QueryContinueDrag(fEscapePressed: BOOL; grfKeyState: Longint): HResult;
  1588.       virtual; cdecl; export; abstract;
  1589.     function GiveFeedback(dwEffect: Longint): HResult; virtual; cdecl; export;  abstract;
  1590.   end;
  1591.  
  1592.   IPersist = class(IUnknown)
  1593.     function GetClassID(var lpClassID: CLSID): HResult; virtual; cdecl; export; abstract;
  1594.   end;
  1595.  
  1596.   IPersistStorage = class(IPersist)
  1597.     function IsDirty: HResult; virtual; cdecl; export; abstract;
  1598.     function InitNew(pStg: IStorage): HResult; virtual; cdecl; export; abstract;
  1599.     function Load(pStg: IStorage): HResult; virtual; cdecl; export; abstract;
  1600.     function Save(pStgSave: IStorage; fSameAsLoad: BOOL): HResult;
  1601.       virtual; cdecl; export; abstract;
  1602.     function SaveCompleted(pStgNew: IStorage): HResult; virtual; cdecl; export; abstract;
  1603.     function HandsOffStorage: HResult; virtual; cdecl; export; abstract;
  1604.   end;
  1605.  
  1606.   IPersistStream = class(IPersist)
  1607.     function IsDirty: HResult; virtual; cdecl; export; abstract;
  1608.     function Load(pStm: IStream): HResult; virtual; cdecl; export; abstract;
  1609.     function Save(pStm: IStream; fClearDirty: BOOL): HResult; virtual; cdecl; export; abstract;
  1610.     function GetSizeMax(var pcbSizeLow, pcbSizeHigh: Longint): HResult; virtual; cdecl; export; abstract;
  1611.   end;
  1612.  
  1613.   IPersistFile = class(IPersist)
  1614.     function IsDirty: HResult; virtual; cdecl; export; abstract;
  1615.     function Load(const lpszFileName: LPCSTR; grfMode: Longint): HResult;
  1616.       virtual; cdecl; export; abstract;
  1617.     function Save(const lpszFileName: LPCSTR; fRemember: BOOL): HResult;
  1618.       virtual; cdecl; export; abstract;
  1619.     function SaveCompleted(const lpszFileName: LPCSTR): HResult;
  1620.       virtual; cdecl; export; abstract;
  1621.     function GetCurFile(var lplpszFileName: PStr): HResult; virtual; cdecl; export; abstract;
  1622.   end;
  1623.  
  1624. { Moniker Object Interfaces }
  1625.  
  1626.   BIND_OPTS = record
  1627.     cbStruct: Longint;
  1628.     grfFlags: Longint;
  1629.     grfMode: Longint;
  1630.     dwTickCountDeadline: Longint;
  1631.   end;
  1632.  
  1633.   PIEnumMoniker = ^IEnumMoniker;
  1634.   PIRunningObjectTable = ^IRunningObjectTable;
  1635.  
  1636.   IBindCtx = class(IUnknown)
  1637.     function RegisterObjectBound(punk: IUnknown): HResult; virtual; cdecl; export; abstract;
  1638.     function RevokeObjectBound(punk: IUnknown): HResult; virtual; cdecl; export; abstract;
  1639.     function ReleaseBoundObjects: HResult; virtual; cdecl; export; abstract;
  1640.     function SetBindOptions(var pbindopts: BIND_OPTS): HResult; virtual; cdecl; export; abstract;
  1641.     function GetBindOptions(var pbindopts: BIND_OPTS): HResult; virtual; cdecl; export; abstract;
  1642.     function GetRunningObjectTable(var pprot: IRunningObjectTable): HResult;
  1643.       virtual; cdecl; export; abstract;
  1644.     function RegisterObjectParam(lpszKey: PStr; punk: IUnknown): HResult;
  1645.       virtual; cdecl; export; abstract;
  1646.     function GetObjectParam(lpszKey: PStr; var ppunk: IUnknown): HResult;
  1647.       virtual; cdecl; export; abstract;
  1648.     function EnumObjectParam(var ppenum: IEnumString): HResult; virtual; cdecl; export; abstract;
  1649.     function RevokeObjectParam(lpszKey: PStr): HResult; virtual; cdecl; export; abstract;
  1650.   end;
  1651.  
  1652.   IMoniker = class(IPersistStream)
  1653.     function BindToObject(pbc: IBindCtx; pmkToLeft: IMoniker;
  1654.       const riidResult: IID; var ppvResult): HResult; virtual; cdecl; export; abstract;
  1655.     function BindToStorage(pbc: IBindCtx; pmkToLeft: IMoniker;
  1656.       const riid: IID; var ppvObj): HResult; virtual; cdecl; export; abstract;
  1657.     function Reduce(pbc: IBindCtx; dwReduceHowFar: Longint; var ppmkToLeft: IMoniker;
  1658.       var ppmkReduced: IMoniker): HResult; virtual; cdecl; export; abstract;
  1659.     function ComposeWith(pmkRight: IMoniker; fOnlyIfNotGeneric: BOOL;
  1660.       var ppmkComposite: IMoniker): HResult; virtual; cdecl; export; abstract;
  1661.     function Enum(fForward: BOOL; var ppenumMoniker: IEnumMoniker): HResult;
  1662.       virtual; cdecl; export; abstract;
  1663.     function IsEqual(pmkOtherMoniker: IMoniker): HResult; virtual; cdecl; export; abstract;
  1664.     function Hash(var pdwHash: Longint): HResult; virtual; cdecl; export; abstract;
  1665.     function IsRunning(pbc: IBindCtx; pmkToLeft: IMoniker; 
  1666.       pmkNewlyRunning: IMoniker): HResult; virtual; cdecl; export; abstract;
  1667.     function GetTimeOfLastChange(pbc: IBindCtx; pmkToLeft: IMoniker; 
  1668.       var pfiletime: TFileTime): HResult; virtual; cdecl; export; abstract;
  1669.     function Inverse(var ppmk: IMoniker): HResult; virtual; cdecl; export; abstract;
  1670.     function CommonPrefixWith(pmkOther: IMoniker; 
  1671.       var ppmkPrefix: IMoniker): HResult; virtual; cdecl; export; abstract;
  1672.     function RelativePathTo(pmkOther: IMoniker; 
  1673.       var ppmkRelPath: IMoniker): HResult; virtual; cdecl; export; abstract;
  1674.     function GetDisplayName(pbc: IBindCtx; pmkToLeft: IMoniker; 
  1675.       var lplpszDisplayName: PStr): HResult; virtual; cdecl; export; abstract;
  1676.     function ParseDisplayName(pbc: IBindCtx; pmkToLeft: IMoniker; 
  1677.       lpszDisplayName: PStr; var pchEaten: Longint; 
  1678.       var ppmkOut: IMoniker): HResult; virtual; cdecl; export; abstract;
  1679.     function IsSystemMoniker(var pdwMksys: Longint): HResult; virtual; cdecl; export; abstract;
  1680.   end;
  1681.  
  1682.   IRunningObjectTable = class(IUnknown)
  1683.     function Register(grfFlags: Longint; var punkObject: IUnknown; 
  1684.       pmkObjectName: IMoniker; var pdwRegister: Longint): HResult; virtual; cdecl; export; abstract;
  1685.     function Revoke(dwRegister: Longint): HResult; virtual; cdecl; export; abstract;
  1686.     function IsRunning(pmkObjectName: IMoniker): HResult; virtual; cdecl; export; abstract;
  1687.     function GetObject(pmkObjectName: IMoniker; 
  1688.       var ppunkObject: IUnknown): HResult; virtual; cdecl; export; abstract;
  1689.     function NoteChangeTime(dwRegister: Longint; 
  1690.       var pfiletime: TFileTime): HResult; virtual; cdecl; export; abstract;
  1691.     function GetTimeOfLastChange(pmkObjectName: IMoniker; 
  1692.       var pfiletime: TFileTime): HResult; virtual; cdecl; export; abstract;
  1693.     function EnumRunning(var ppenumMoniker: IEnumMoniker): HResult; virtual; cdecl; export; abstract;
  1694.   end;
  1695.  
  1696.   IEnumMoniker = class(IUnknown)
  1697.     function Next(celt: Longint; var rgelt: IMoniker;
  1698.       var pceltFetched: Longint): HResult; virtual; cdecl; export; abstract;
  1699.     function Skip(celt: Longint): HResult; virtual; cdecl; export; abstract;
  1700.     function Reset: HResult; virtual; cdecl; export; abstract;
  1701.     function Clone(var ppenm: IEnumMoniker): HResult; virtual; cdecl; export; abstract;
  1702.   end;
  1703.  
  1704. { OLE Object Interfaces }
  1705.  
  1706.   IEnumOLEVERB = class(IUnknown)
  1707.     function Next(celt: Longint; var rgelt: OLEVERB; 
  1708.       var pceltFetched: Longint): HResult; virtual; cdecl; export; abstract;
  1709.     function Skip(celt: Longint): HResult; virtual; cdecl; export; abstract;
  1710.     function Reset: HResult; virtual; cdecl; export; abstract;
  1711.     function Clone(var ppenm: IEnumOLEVERB): HResult; virtual; cdecl; export; abstract;
  1712.   end;
  1713.  
  1714.   IOleClientSite = class;
  1715.  
  1716.   IOleObject = class(IUnknown)
  1717.     function SetClientSite(var pClientSite: IOleClientSite): HResult;
  1718.       virtual; cdecl; export; abstract;
  1719.     function GetClientSite(var ppClientSite: IOleClientSite): HResult; 
  1720.       virtual; cdecl; export; abstract;
  1721.     function SetHostNames(const szContainerApp: LPCSTR;
  1722.       const szContainerObj: LPCSTR): HResult; virtual; cdecl; export; abstract;
  1723.     function Close(dwSaveOption: Longint): HResult; virtual; cdecl; export; abstract;
  1724.     function SetMoniker(dwWhichMoniker: Longint; pmk: IMoniker): HResult;
  1725.       virtual; cdecl; export; abstract;
  1726.     function GetMoniker(dwAssign: Longint; dwWhichMoniker: Longint; 
  1727.       var ppmk: IMoniker): HResult; virtual; cdecl; export; abstract;
  1728.     function InitFromData(pDataObject: IDataObject; fCreation: BOOL; 
  1729.       dwReserved: Longint): HResult; virtual; cdecl; export; abstract;
  1730.     function GetClipboardData(dwReserved: Longint;
  1731.       var ppDataObject: IDataObject): HResult; virtual; cdecl; export; abstract;
  1732.     function DoVerb(iVerb: Longint; lpmsg: LPMSG; var pActiveSite: IOleClientSite;
  1733.       lindex: Longint; hwndParent: HWND; lprcPosRect: TRect): HResult; virtual; cdecl; export; abstract;
  1734.     function EnumVerbs(var ppenumOleVerb: IEnumOLEVERB): HResult; virtual; cdecl; export; abstract;
  1735.     function Update: HResult; virtual; cdecl; export; abstract;
  1736.     function IsUpToDate: HResult; virtual; cdecl; export; abstract;
  1737.     function GetUserClassID(var pClsid: CLSID): HResult; virtual; cdecl; export; abstract;
  1738.     function GetUserType(dwFormOfType: Longint; var pszUserType: PStr): HResult; 
  1739.       virtual; cdecl; export; abstract;
  1740.     function SetExtent(dwDrawAspect: Longint; var lpsizel: SizeLong): HResult; 
  1741.       virtual; cdecl; export; abstract;
  1742.     function GetExtent(dwDrawAspect: Longint; var lpsizel: SizeLong): HResult;
  1743.       virtual; cdecl; export; abstract;
  1744.     function Advise(pAdvSink: IAdviseSink; var pdwConnection: Longint): HResult;
  1745.       virtual; cdecl; export; abstract;
  1746.     function Unadvise(dwConnection: Longint): HResult; virtual; cdecl; export; abstract;
  1747.     function EnumAdvise(var ppenumAdvise: IEnumStatData): HResult; virtual; cdecl; export; abstract;
  1748.     function GetMiscStatus(dwAspect: Longint; var pdwStatus: Longint): HResult; 
  1749.       virtual; cdecl; export; abstract;
  1750.     function SetColorScheme(lpLogpal: LPLOGPALETTE): HResult; virtual; cdecl; export; abstract;
  1751.   end;
  1752.  
  1753.   IOleClientSite = class(IUnknown)
  1754.     function SaveObject: HResult; virtual; cdecl; export; abstract;
  1755.     function GetMoniker(dwAssign: Longint; dwWhichMoniker: Longint; 
  1756.       var ppmk: IMoniker): HResult; virtual; cdecl; export; abstract;
  1757.     function GetContainer(var ppContainer: IOleContainer): HResult; virtual; cdecl; export; abstract;
  1758.     function ShowObject: HResult; virtual; cdecl; export; abstract;
  1759.     function OnShowWindow(fShow: BOOL): HResult; virtual; cdecl; export; abstract;
  1760.     function RequestNewObjectLayout: HResult; virtual; cdecl; export; abstract;
  1761.   end;
  1762.  
  1763. { OLE Runnable Object Interface }
  1764.  
  1765.   IRunnableObject = class(IUnknown)
  1766.     function GetRunningClass(var lpClsid: CLSID): HResult; virtual; cdecl; export; abstract;
  1767.     function Run(pbc: IBindCtx): HResult; virtual; cdecl; export; abstract;
  1768.     function IsRunning: Integer; virtual; cdecl; export; abstract;
  1769.     function LockRunning(fLock: BOOL; fLastUnlockCloses: BOOL): HResult;
  1770.       virtual; cdecl; export; abstract;
  1771.     function SetContainedObject(fContained: BOOL): HResult; virtual; cdecl; export; abstract;
  1772.   end;
  1773.  
  1774. { OLE Container Interfaces }
  1775.  
  1776.   IParseDisplayName = class(IUnknown)
  1777.     function ParseDisplayName(pbc: IBindCtx; lpszDisplayName: PStr;
  1778.       var pchEaten: Longint; var ppmkOut: IMoniker): HResult; virtual; cdecl; export; abstract;
  1779.   end;
  1780.  
  1781.   IOleContainer = class(IParseDisplayName)
  1782.     function ParseDisplayName(pbc: IBindCtx; lpszDisplayName: PStr;
  1783.       var pchEaten: Longint; var ppmkOut: IMoniker): HResult; virtual; cdecl; export; abstract;
  1784.     function EnumObjects(grfFlags: Longint;
  1785.       var ppenumUnknown: IEnumUnknown): HResult; virtual; cdecl; export; abstract;
  1786.     function LockContainer(fLock: BOOL): HResult; virtual; cdecl; export; abstract;
  1787.   end;
  1788.  
  1789.   IOleItemContainer = class(IOleContainer)
  1790.     function GetObject(lpszItem: PStr; dwSpeedNeeded: Longint;
  1791.       pbc: IBindCtx; const riid: IID; var ppvObject): HResult; virtual; cdecl; export; abstract;
  1792.     function GetObjectStorage(lpszItem: PStr; pbc: IBindCtx; const riid: IID;
  1793.       var ppvStorage): HResult; virtual; cdecl; export; abstract;
  1794.     function IsRunning(lpszItem: PStr): HResult; virtual; cdecl; export; abstract;
  1795.   end;
  1796.  
  1797. { OLE Advise Holder Interface }
  1798.  
  1799.   IOleAdviseHolder = class(IUnknown)
  1800.     function Advise(pAdvise: IAdviseSink; var pdwConnection: Longint): HResult;
  1801.       virtual; cdecl; export; abstract;
  1802.     function Unadvise(dwConnection: Longint): HResult; virtual; cdecl; export; abstract;
  1803.     function EnumAdvise(var ppenumAdvise: IEnumStatData): HResult; virtual; cdecl; export; abstract;
  1804.     function SendOnRename(pmk: IMoniker): HResult; virtual; cdecl; export; abstract;
  1805.     function SendOnSave: HResult; virtual; cdecl; export; abstract;
  1806.     function SendOnClose: HResult; virtual; cdecl; export; abstract;
  1807.   end;
  1808.  
  1809. { OLE Link Interface }
  1810.  
  1811.   IOleLink = class(IUnknown)
  1812.     function SetUpdateOptions(dwUpdateOpt: Longint): HResult;
  1813.       virtual; cdecl; export; abstract;
  1814.     function GetUpdateOptions(var pdwUpdateOpt: Longint): HResult; virtual; cdecl; export; abstract;
  1815.     function SetSourceMoniker(pmk: IMoniker; const rclsid: IID): HResult;
  1816.       virtual; cdecl; export; abstract;
  1817.     function GetSourceMoniker(var ppmk: IMoniker): HResult; virtual; cdecl; export; abstract;
  1818.     function SetSourceDisplayName(const lpszDisplayName: LPCSTR): HResult;
  1819.       virtual; cdecl; export; abstract;
  1820.     function GetSourceDisplayName(var lplpszDisplayName: PStr): HResult;
  1821.       virtual; cdecl; export; abstract;
  1822.     function BindToSource(bindflags: Longint; pbc: IBindCtx): HResult;
  1823.       virtual; cdecl; export; abstract;
  1824.     function BindIfRunning: HResult; virtual; cdecl; export; abstract;
  1825.     function GetBoundSource(var ppUnk: IUnknown): HResult; virtual; cdecl; export; abstract;
  1826.     function UnbindSource: HResult; virtual; cdecl; export; abstract;
  1827.     function Update(pbc: IBindCtx): HResult; virtual; cdecl; export; abstract;
  1828.   end;
  1829.  
  1830. { OLE InPlace Editing Interfaces }
  1831.  
  1832. { OleInPlaceFrameInfo}
  1833.   OIFI = record
  1834.     cb: Word;
  1835.     fMDIApp: BOOL;
  1836.     hwndFrame: HWND;
  1837.     haccel: HAccel;
  1838.     cAccelEntries: Integer;
  1839.   end;
  1840.  
  1841.   OleMenuGroupWidths = record
  1842.     width: Array[1..6] of Longint;
  1843.   end;
  1844.  
  1845.   BORDERWIDTHS = TRect;
  1846.   LPBORDERWIDTHS = ^TRect;
  1847.   LPCBORDERWIDTHS = ^TRect;
  1848.  
  1849.   IOleWindow = class(IUnknown)
  1850.     function GetWindow(var lphwnd: HWND): HResult; virtual; cdecl; export; abstract;
  1851.     function ContextSensitiveHelp(fEnterMode: BOOL): HResult; virtual; cdecl; export; abstract;
  1852.   end;
  1853.  
  1854.   IOleInPlaceObject = class(IOleWindow)
  1855.     function InPlaceDeactivate: HResult; virtual; cdecl; export; abstract;
  1856.     function UIDeactivate: HResult; virtual; cdecl; export; abstract;
  1857.     function SetObjectRects(const lprcPosRect: TRect;
  1858.       const lprcClipRect: TRect): HResult; virtual; cdecl; export; abstract;
  1859.     function ReactivateAndUndo: HResult; virtual; cdecl; export; abstract;
  1860.   end;
  1861.  
  1862.  
  1863.   IOleInPlaceUIWindow = class;
  1864.   IOleInPlaceActiveObject = class(IOleWindow)
  1865.     function TranslateAccelerator(lpmsg: LPMSG): HResult; virtual; cdecl; export; abstract;
  1866.     function OnFrameWindowActivate(fActivate: BOOL): HResult; virtual; cdecl; export; abstract;
  1867.     function OnDocWindowActivate(fActivate: BOOL): HResult; virtual; cdecl; export; abstract;
  1868.     function ResizeBorder(const lprectBorder: TRect; lpUIWindow: IOleInPlaceUIWindow;
  1869.       fFrameWindow: BOOL): HResult; virtual; cdecl; export; abstract;
  1870.     function EnableModeless(fEnable: BOOL): HResult; virtual; cdecl; export; abstract;
  1871.   end;
  1872.  
  1873.   IOleInPlaceUIWindow = class(IOleWindow)
  1874.     function GetBorder(var lprectBorder: TRect): HResult; virtual; cdecl; export; abstract;
  1875.     function RequestBorderSpace(const lpborderwidths: TRect): HResult; virtual; cdecl; export; abstract;
  1876.     function SetBorderSpace(const lpborderwidths: TRect): HResult; virtual; cdecl; export; abstract;
  1877.     function SetActiveObject(lpActiveObject: IOleInPlaceActiveObject;
  1878.       const lpszObjName: LPCSTR): HResult; virtual; cdecl; export; abstract;
  1879.   end;
  1880.  
  1881.   IOleInPlaceFrame = class(IOleInPlaceUIWindow)
  1882.     function InsertMenus(hmenuShared: HMenu;
  1883.       var lpMenuWidths: OleMenuGroupWidths): HResult; virtual; cdecl; export; abstract;
  1884.     function SetMenu(hmenuShared: HMenu; holemenu: Word;
  1885.       hwndActiveObject: HWND): HResult; virtual; cdecl; export; abstract;
  1886.     function RemoveMenus(hmenuShared: HMenu): HResult; virtual; cdecl; export; abstract;
  1887.     function SetStatusText(const lpszStatusText: LPCSTR): HResult; virtual; cdecl; export; abstract;
  1888.     function EnableModeless(fEnable: BOOL): HResult; virtual; cdecl; export; abstract;
  1889.     function TranslateAccelerator(lpmsg: LPMSG; wID: Word): HResult; virtual; cdecl; export; abstract;
  1890.   end;
  1891.  
  1892.  
  1893.   IOleInPlaceSite = class(IOleWindow)
  1894.     function CanInPlaceActivate: HResult; virtual; cdecl; export; abstract;
  1895.     function OnInPlaceActivate: HResult; virtual; cdecl; export; abstract;
  1896.     function OnUIActivate: HResult; virtual; cdecl; export; abstract;
  1897.     function GetWindowContext(var lplpFrame: IOleInPlaceFrame;
  1898.       var lplpDoc: IOleInPlaceUIWindow; var lprcPosRect: TRect;
  1899.       var lprcClipRect: TRect; var lpFrameInfo: OIFI): HResult; virtual; cdecl; export; abstract;
  1900.     function Scroll(scrollExtent: Size): HResult; virtual; cdecl; export; abstract;
  1901.     function OnUIDeactivate(fUndoable: BOOL): HResult; virtual; cdecl; export; abstract;
  1902.     function OnInPlaceDeactivate: HResult; virtual; cdecl; export; abstract;
  1903.     function DiscardUndoState: HResult; virtual; cdecl; export; abstract;
  1904.     function DeactivateAndUndo: HResult; virtual; cdecl; export; abstract;
  1905.     function OnPosRectChange(const lprcPosRect: TRect): HResult; virtual; cdecl; export; abstract;
  1906.   end;
  1907.  
  1908. { OLE API Prototypes }
  1909.  
  1910. {*********** Function Declarations *************}
  1911.  
  1912. { STD Object API Prototypes }
  1913.  
  1914. function GetScode(hr: HResult): SCode;
  1915. function ResultFromScode(sc: SCode): HResult;
  1916. function CoBuildVersion: HResult;
  1917. function PropagateResult(hrPrev: HResult; scNew: SCode): HResult;
  1918.  
  1919. { inituninit }
  1920.  
  1921. function CoInitialize(pMalloc: IMalloc): HResult;
  1922. procedure CoUninitialize;
  1923. function CoGetMalloc(dwMemContext: Longint; var ppMalloc: IMalloc): HResult;
  1924. function CoGetCurrentProcess: Longint;
  1925. function CoCreateStandardMalloc(memctx: Longint; var ppMalloc: IMalloc): HResult;
  1926.  
  1927. { register revoke get class objects }
  1928.  
  1929. function CoGetClassObject(const rclsid: IID; dwClsContext: Longint;
  1930.   pvReserved: LPVOID; const riid: IID; var ppv): HResult;
  1931. function CoRegisterClassObject(const rclsid: IID; pUnk: IUnknown;
  1932.   dwClsContext: Longint; flags: Longint; var lpdwRegister: Longint): HResult;
  1933. function CoRevokeClassObject(dwRegister: Longint): HResult;
  1934.  
  1935. { marshaling interface pointers }
  1936.  
  1937. function CoMarshalInterface(pStm: IStream; const riid: IID; pUnk: IUnknown;
  1938.   dwDestContext: Longint; pvDestContext: LPVOID; mshlflags: Longint): HResult;
  1939. function CoUnmarshalInterface(pStm: IStream; const riid: IID; var ppv): HResult;
  1940. function CoMarshalHresult(pstm: IStream; hresult: HResult): HResult;
  1941. function CoUnmarshalHresult(pstm: IStream; var phresult: HResult): HResult;
  1942. function CoReleaseMarshalData(pStm: IStream): HResult;
  1943. function CoDisconnectObject(pUnk: IUnknown; dwReserved: Longint): HResult;
  1944. function CoLockObjectExternal(pUnk: IUnknown; fLock: BOOL; fLastUnlockReleases: BOOL): HResult;
  1945. function CoGetStandardMarshal(const riid: IID; pUnk: IUnknown; dwDestContext: Longint;
  1946.   pvDestContext: LPVOID; mshlflags: Longint; var ppMarshal: IMarshal): HResult;
  1947. function CoIsHandlerConnected(pUnk: IUnknown): Boolean;
  1948.  
  1949. { dll loading helpers; keeps track of ref counts and unloads all on exit }
  1950.  
  1951. function CoLoadLibrary(lpszLibName: PStr; bAutoFree: BOOL): THandle;
  1952. procedure CoFreeLibrary(hInst: THandle);
  1953. procedure CoFreeAllLibraries;
  1954. procedure CoFreeUnusedLibraries;
  1955.  
  1956. { helper for creating instances }
  1957.  
  1958. function CoCreateInstance(const rclsid: IID; pUnkOuter: IUnknown;
  1959.   dwClsContext: Longint; const riid: IID; var ppv): HResult;
  1960.  
  1961. { other helpers }
  1962.  
  1963. function IsEqualGUID(const rguid1: GUID; const rguid2: GUID): Boolean;
  1964. function IsEqualIID(const rguid1: IID; const rguid2: IID): Boolean;
  1965. function IsEqualCLSID(const rguid1: CLSID; const rguid2: CLSID): Boolean;
  1966. function StringFromCLSID(const rclsid: IID; var lplpsz: PStr): HResult;
  1967. function CLSIDFromString(lpsz: PStr; var pclsid: CLSID): HResult;
  1968. function StringFromIID(const rclsid: IID; var lplpsz: PStr): HResult;
  1969. function IIDFromString(lpsz: PStr; var lpiid: IID): HResult;
  1970. function CoIsOle1Class(const rclsid: IID): Boolean;
  1971. function ProgIDFromCLSID(const clsid: IID; var lplpszProgID: PStr): HResult;
  1972. function CLSIDFromProgID(const lpszProgID: LPCSTR; var lpclsid: CLSID): HResult;
  1973. function StringFromGUID2(const rguid: IID; lpsz: PStr; cbMax: Integer): Integer;
  1974. function CoCreateGuid(var pguid: GUID): HResult;
  1975. function CoFileTimeToDosDateTime(var lpFileTime: TFileTime; var lpDosDate: Word;
  1976.   var lpDosTime: Word): Boolean;
  1977. function CoDosDateTimeToFileTime(nDosDate: Word; nDosTime: Word;
  1978.   var lpFileTime: TFileTime): Boolean;
  1979. function CoFileTimeNow(var lpFileTime: TFileTime): HResult;
  1980. function CoRegisterMessageFilter(lpMessageFilter: IMessageFilter;
  1981.   var lplpMessageFilter: IMessageFilter): HResult;
  1982.  
  1983. { TreatAs APIS }
  1984.  
  1985. function CoGetTreatAsClass(const clsidOld: IID; var pClsidNew: CLSID): HResult;
  1986. function CoTreatAsClass(const clsidOld: IID; const clsidNew: IID): HResult;
  1987.  
  1988. { the server dlls must define their DllGetClassObject and DllCanUnloadNow
  1989.   to match these; the typedefs are located here to ensure all are changed at
  1990.   the same time. }
  1991.  
  1992. function DllGetClassObject(const rclsid: IID; const riid: IID; var ppv): HResult;
  1993. function DllCanUnloadNow: HResult;
  1994.  
  1995. { DV APIs }
  1996.  
  1997. function CreateDataAdviseHolder(var ppDAHolder: IDataAdviseHolder): HResult;
  1998. function CreateDataCache(var pUnkOuter: IUnknown; const rclsid: IID;
  1999.   const iid: IID; var ppv): HResult;
  2000.  
  2001. { Storage API Prototypes }
  2002.  
  2003. function StgCreateDocfile(const pwcsName: LPCSTR; grfMode: Longint;
  2004.   reserved: Longint; var ppstgOpen: IStorage): HResult;
  2005. function StgCreateDocfileOnILockBytes(plkbyt: ILockBytes; grfMode: Longint;
  2006.   reserved: Longint; var ppstgOpen: IStorage): HResult;
  2007. function StgOpenStorage(const pwcsName: LPCSTR; pstgPriority: IStorage; grfMode: Longint;
  2008.   var snbExclude: PStr; reserved: Longint; var ppstgOpen: IStorage): HResult;
  2009. function StgOpenStorageOnILockBytes(plkbyt: ILockBytes; pstgPriority: IStorage;
  2010.   grfMode: Longint; var snbExclude: PStr; reserved: Longint; var ppstgOpen: IStorage): HResult;
  2011. function StgIsStorageFile(const pwcsName: LPCSTR): HResult;
  2012. function StgIsStorageILockBytes(plkbyt: ILockBytes): HResult;
  2013. function StgSetTimes(const lpszName: LPCSTR; const pctime: TFileTime;
  2014.   const patime: TFileTime; const pmtime: TFileTime): HResult;
  2015.  
  2016. { IMoniker methods }
  2017.  
  2018. function BindMoniker(pmk: IMoniker; grfOpt: Longint; const iidResult: IID;
  2019.   var ppvResult): HResult;
  2020. function ParseDisplayName(pbc: IBindCtx; szUserName: PStr;
  2021.   var pchEaten: Longint; var ppmk: IMoniker): HResult;
  2022. function MonikerRelativePathTo(pmkSrc: IMoniker; pmkDest: IMoniker;
  2023.   var ppmkRelPath: IMoniker; fCalledFromMethod: BOOL): HResult;
  2024. function MonikerCommonPrefixWith(pmkThis: IMoniker; pmkOther: IMoniker;
  2025.   var ppmkCommon: IMoniker): HResult;
  2026. function CreateBindCtx(reserved: Longint; var ppbc: IBindCtx): HResult;
  2027. function CreateGenericComposite(pmkFirst: IMoniker; pmkRest: IMoniker;
  2028.   var ppmkComposite: IMoniker): HResult;
  2029. function GetClassFile(const szFilename: LPCSTR; var pclsid: CLSID): HResult;
  2030. function CreateFileMoniker(lpszPathName: PStr; var ppmk: IMoniker): HResult;
  2031. function CreateItemMoniker(lpszDelim: PStr; lpszItem: PStr; var ppmk: IMoniker): HResult;
  2032. function CreateAntiMoniker(var ppmk: IMoniker): HResult;
  2033. function CreatePointerMoniker(punk: IUnknown; var ppmk: IMoniker): HResult;
  2034. function GetRunningObjectTable(reserved: Longint; var pprot: IRunningObjectTable): HResult;
  2035.  
  2036. { OLE API Prototypes }
  2037.  
  2038. function OleBuildVersion: HResult;
  2039.  
  2040. { helper functions }
  2041.  
  2042. function ReadClassStg(pStg: IStorage; var pclsid: CLSID): HResult;
  2043. function WriteClassStg(pStg: IStorage; const rclsid: IID): HResult;
  2044. function ReadClassStm(pStm: IStream; var pclsid: CLSID): HResult;
  2045. function WriteClassStm(pStm: IStream; const rclsid: IID): HResult;
  2046. function WriteFmtUserTypeStg(pstg: IStorage; cf: CLIPFORMAT; lpszUserType: PStr): HResult;
  2047. function ReadFmtUserTypeStg(pstg: IStorage; var pcf: CLIPFORMAT;
  2048.   var lplpszUserType: PStr): HResult;
  2049.  
  2050. { initterm }
  2051.  
  2052. function OleInitialize(pMalloc: IMalloc): HResult;
  2053. procedure OleUninitialize;
  2054.  
  2055. { APIs to query whether (EmbeddedLinked) object can be created from
  2056.    the data object }
  2057.  
  2058. function OleQueryLinkFromData(pSrcDataObject: IDataObject): HResult;
  2059. function OleQueryCreateFromData(pSrcDataObject: IDataObject): HResult;
  2060.  
  2061. { Object creation APIs }
  2062.  
  2063. function OleCreate(const rclsid: IID; const riid: IID; renderopt: Longint;
  2064.   var pFormatEtc: FORMATETC; pClientSite: IOleClientSite;
  2065.   pStg: IStorage; var ppvObj): HResult;
  2066. function OleCreateFromData(pSrcDataObj: IDataObject; const riid: IID;
  2067.   renderopt: Longint; var pFormatEtc: FORMATETC; pClientSite: IOleClientSite;
  2068.   pStg: IStorage; var ppvObj): HResult;
  2069. function OleCreateLinkFromData(pSrcDataObj: IDataObject; const riid: IID;
  2070.   renderopt: Longint; var pFormatEtc: FORMATETC; pClientSite: IOleClientSite;
  2071.   pStg: IStorage; var ppvObj): HResult;
  2072. function OleCreateStaticFromData(pSrcDataObj: IDataObject; const iid: IID;
  2073.   renderopt: Longint; var pFormatEtc: FORMATETC; pClientSite: IOleClientSite;
  2074.   pStg: IStorage; var ppvObj): HResult;
  2075. function OleCreateLink(pmkLinkSrc: IMoniker; const riid: IID;
  2076.   renderopt: Longint; var lpFormatEtc: FORMATETC; pClientSite: IOleClientSite;
  2077.   pStg: IStorage; var ppvObj): HResult;
  2078. function OleCreateLinkToFile(const lpszFileName: LPCSTR; const riid: IID;
  2079.   renderopt: Longint; var lpFormatEtc: FORMATETC; pClientSite: IOleClientSite;
  2080.   pStg: IStorage; var ppvObj): HResult;
  2081. function OleCreateFromFile(const rclsid: IID; const lpszFileName: LPCSTR;
  2082.   const riid: IID; renderopt: Longint; var lpFormatEtc: FORMATETC;
  2083.   pClientSite: IOleClientSite; pStg: IStorage; var ppvObj): HResult;
  2084. function OleLoad(pStg: IStorage; const riid: IID; pClientSite: IOleClientSite;
  2085.   var ppvObj): HResult;
  2086. function OleSave(pPS: IPersistStorage; pStg: IStorage; fSameAsLoad: BOOL): HResult;
  2087. function OleLoadFromStream(pStm: IStream; const iidInterface: IID; var ppvObj): HResult;
  2088. function OleSaveToStream(pPStm: IPersistStream; pStm: IStream): HResult;
  2089. function OleSetContainedObject(pUnknown: IUnknown; fContained: BOOL): HResult;
  2090. function OleNoteObjectVisible(pUnknown: IUnknown; fVisible: BOOL): HResult;
  2091.  
  2092. { DragDrop APIs }
  2093.  
  2094. function RegisterDragDrop(hwnd: HWND; pDropTarget: IDropTarget): HResult;
  2095. function RevokeDragDrop(hwnd: HWND): HResult;
  2096. function DoDragDrop(pDataObj: IDataObject; pDropSource: IDropSource; 
  2097.   dwOKEffects: Longint; var pdwEffect: Longint): HResult; 
  2098.                         
  2099. { Clipboard APIs }
  2100.  
  2101. function OleSetClipboard(pDataObj: IDataObject): HResult;
  2102. function OleGetClipboard(var ppDataObj: IDataObject): HResult;
  2103. function OleFlushClipboard: HResult;
  2104. function OleIsCurrentClipboard(pDataObj: IDataObject): HResult;
  2105.  
  2106. { InPlace Editing APIs }
  2107.  
  2108. function OleCreateMenuDescriptor(hmenuCombined: HMenu; var lpMenuWidths: OleMenuGroupWidths): Word;
  2109. function OleSetMenuDescriptor(holemenu: Word; hwndFrame: HWND; 
  2110.   hwndActiveObject: HWND; lpFrame: IOleInPlaceFrame; lpActiveObj: IOleInPlaceActiveObject): HResult; 
  2111. function OleDestroyMenuDescriptor(holemenu: Word): HResult;
  2112. function OleTranslateAccelerator(lpFrame: IOleInPlaceFrame; 
  2113.   var lpFrameInfo: OIFI; lpmsg: LPMSG): HResult;
  2114.  
  2115. { Helper APIs }
  2116.  
  2117. function OleDuplicateData(hSrc: THandle; cfFormat: CLIPFORMAT; uiFlags: Word): THandle;
  2118. function OleDraw(pUnknown: IUnknown; dwAspect: Longint; hdcDraw: HDC;
  2119.   const lprcBounds: TRect): HResult;
  2120. function OleRun(pUnknown: IUnknown): HResult;
  2121. function OleIsRunning(pObject: IOleObject): Boolean;
  2122. function OleLockRunning(pUnknown: IUnknown; fLock: BOOL; fLastUnlockCloses: BOOL): HResult;
  2123. procedure ReleaseStgMedium(var p1: STGMEDIUM);
  2124. function CreateOleAdviseHolder(var ppOAHolder: IOleAdviseHolder): HResult; 
  2125. function OleCreateDefaultHandler(const clsid: IID; pUnkOuter: IUnknown;
  2126.   const riid: IID; var lplpObj): HResult;
  2127. function OleCreateEmbeddingHelper(const clsid: IID; pUnkOuter: IUnknown; 
  2128.   flags: Longint; pCF: IClassFactory; const riid: IID; var lplpObj): HResult;
  2129. function IsAccelerator(hAccel: HAccel; cAccelEntries: Integer; lpMsg: LPMSG;
  2130.   var lpwCmd: Word): Boolean;
  2131.  
  2132. { Icon extraction Helper APIs }
  2133.  
  2134. function OleGetIconOfFile(lpszPath: PStr; fUseFileAsLabel: BOOL): HGlobal; 
  2135. function OleGetIconOfClass(const rclsid: IID; lpszLabel: PStr; fUseTypeAsLabel: BOOL): HGlobal;
  2136. function OleMetafilePictFromIconAndLabel(hIcon: HIcon; lpszLabel: PStr; 
  2137.   lpszSourceFile: PStr; iIconIndex: Word): HGlobal; 
  2138.  
  2139. { Registration Database Helper APIs }
  2140.  
  2141. function OleRegGetUserType(const clsid: IID; dwFormOfType: Longint; var pszUserType: PStr): HResult;
  2142. function OleRegGetMiscStatus(const clsid: IID; dwAspect: Longint; var pdwStatus: Longint): HResult;
  2143. function OleRegEnumFormatEtc(const clsid: IID; dwDirection: Longint; var ppenum: IEnumFORMATETC): HResult;
  2144. function OleRegEnumVerbs(const clsid: IID; var ppenum: IEnumOLEVERB): HResult;
  2145.  
  2146. { OLE 1.0 conversion APIS }
  2147.  
  2148. function OleConvertIStorageToOLESTREAM(pstg: IStorage; var polestm: OLESTREAM): HResult;
  2149. function OleConvertOLESTREAMToIStorage(var polestm: OLESTREAM; pstg: IStorage;
  2150.   const ptd: DVTargetDevice): HResult;
  2151. function OleConvertIStorageToOLESTREAMEx(pstg: IStorage; cfFormat: CLIPFORMAT;
  2152.   lWidth: Longint; lHeight: Longint; dwSize: Longint; var pmedium: STGMEDIUM; 
  2153.   var polestm: OLESTREAM): HResult;
  2154. function OleConvertOLESTREAMToIStorageEx(var polestm: OLESTREAM; pstg: IStorage; 
  2155.   var pcfFormat: CLIPFORMAT; var plwWid: Longint; var plHeight: Longint; 
  2156.   var pdwSize: Longint; var pmedium: STGMEDIUM): HResult;
  2157.  
  2158. { Storage Utility APIs }
  2159.  
  2160. function GetHGlobalFromILockBytes(plkbyt: ILockBytes; var phglobal: HGlobal): HResult;
  2161. function CreateILockBytesOnHGlobal(hGlobal: HGlobal; fDeleteOnRelease: BOOL;
  2162.   var pplkbyt: ILockBytes): HResult;
  2163. function GetHGlobalFromStream(pstm: IStream; var phglobal: HGlobal): HResult;
  2164. function CreateStreamOnHGlobal(hGlobal: HGlobal; fDeleteOnRelease: BOOL; 
  2165.   var ppstm: IStream): HResult;
  2166.  
  2167. { ConvertTo APIS }
  2168.  
  2169. function OleDoAutoConvert(pStg: IStorage; var pClsidNew: CLSID): HResult; 
  2170. function OleGetAutoConvert(const clsidOld: IID; var pClsidNew: CLSID): HResult;
  2171. function OleSetAutoConvert(const clsidOld: IID; const clsidNew: IID): HResult;
  2172. function GetConvertStg(pStg: IStorage): HResult;
  2173. function SetConvertStg(pStg: IStorage; fConvert: BOOL): HResult;
  2174.  
  2175. implementation
  2176.