home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Headers / OLE2.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-02  |  54.7 KB  |  1,631 lines  |  [TEXT/????]

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * ole2.h -         Main OLE2 header; includes all subcomponents                  *
  4. *                                                                             *
  5. *               OLE Version 2.0                                               *
  6. *                                                                             *
  7. *               Copyright (c) 1992-1994, Microsoft Corp. All rights reserved. *
  8. *                                                                             *
  9. \*****************************************************************************/
  10.  
  11.  
  12. #if !defined(__OLE2__) && !defined(_OLE2_H_)
  13. #define __OLE2__
  14. #define _OLE2_H_
  15.  
  16.  
  17. #ifdef WLM
  18. #include "macname1.h"
  19. #define WINGS
  20.  
  21. #endif // WLM
  22.  
  23.  
  24. #if !defined(__MACPUB__)
  25. #include <macpub.h>
  26. #endif
  27.  
  28.  
  29. /****** Standard Object Definitions *****************************************/
  30.  
  31. #ifndef __COMPOBJ__
  32. #include <compobj.h>
  33. #endif
  34.  
  35.  
  36. // *************** FACILITY_ITF scodes common to all interfaces ************
  37. //
  38. // By convention, OLE interfaces divide the FACILITY_ITF range of errors
  39. // into nonoverlapping subranges.  If an interface returns a FACILITY_ITF 
  40. // scode, it must be from the range associated with that interface or from
  41. // the shared range: OLE_E_FIRST...OLE_E_LAST.
  42. //
  43.  
  44. // error codes
  45.  
  46. #define OLE_E_OLEVERB               (OLE_E_FIRST)
  47. // invalid OLEVERB structure  
  48.  
  49. #define OLE_E_ADVF                  (OLE_E_FIRST+1)
  50. // invalid advise flags
  51.  
  52. #define OLE_E_ENUM_NOMORE           (OLE_E_FIRST+2)
  53. // you can't enuemrate any more, because the associated data is missing
  54.  
  55. #define OLE_E_ADVISENOTSUPPORTED    (OLE_E_FIRST+3)
  56. // this implementation doesn't take advises
  57.  
  58. #define OLE_E_NOCONNECTION          (OLE_E_FIRST+4)
  59. // there is no connection for this connection id
  60.  
  61. #define OLE_E_NOTRUNNING            (OLE_E_FIRST+5)
  62. // need run the object to perform this operation
  63.  
  64. #define OLE_E_NOCACHE               (OLE_E_FIRST+6)
  65. // there is no cache to operate on
  66.  
  67. #define OLE_E_BLANK                 (OLE_E_FIRST+7)
  68. // Uninitialized object
  69.  
  70. #define OLE_E_CLASSDIFF             (OLE_E_FIRST+8)
  71. // linked object's source class has changed 
  72.  
  73. #define OLE_E_CANT_GETMONIKER       (OLE_E_FIRST+9)
  74. // not able to get the moniker of the object
  75.  
  76. #define OLE_E_CANT_BINDTOSOURCE     (OLE_E_FIRST+10)
  77. // not able to bind to the source
  78.  
  79. #define OLE_E_STATIC                (OLE_E_FIRST+11)
  80. // object is static, operation not allowed
  81.  
  82. #define OLE_E_PROMPTSAVECANCELLED   (OLE_E_FIRST+12)
  83. // user cancelled out of save dialog
  84.  
  85. #define OLE_E_INVALIDRECT            (OLE_E_FIRST+13)
  86. // invalid rectangle 
  87.  
  88. #define OLE_E_WRONGCOMPOBJ          (OLE_E_FIRST+14)
  89. // compobj.dll is too old for the ole2.dll initialized
  90.  
  91. #define OLE_E_INVALIDHWND           (OLE_E_FIRST+15)
  92. // invalid window handle
  93.  
  94. #define OLE_E_NOT_INPLACEACTIVE     (OLE_E_FIRST+16)
  95. // object is not in any of the inplace active states  
  96.  
  97. #define OLE_E_CANTCONVERT            (OLE_E_FIRST+17)
  98. // not able to convert the object 
  99.  
  100. #define OLE_E_NOSTORAGE                (OLE_E_FIRST+18)
  101. // not able to perform the operation because object is not given storage yet.
  102.  
  103. typedef enum {
  104.     OLE_E_NOEXTENSION    = OLE_E_NOSTORAGE +1,    // no extension at startup
  105.     OLE_E_VERSEXTENSION,                        // extension has wrong version #
  106.     OLE_E_IPBUSY,                                // cannot get inplace resource
  107.     OLE_E_NOT_FRONT_PROCESS,                    // inplace container unexpectedly in background
  108.     OLE_E_WRONG_MENU,                            // holemenu != prev holemenu
  109.     OLE_E_MENU_NOT_PATCHED,                        // menubar is not hashed
  110.     OLE_E_MENUID_NOT_HASHED,                    // id was never hashed
  111.     OLE_E_foo
  112. } inplace_errors;
  113.  
  114.  
  115.  
  116.  
  117. #define DVGEN_E_FIRST               (OLE_E_FIRST+100)
  118.  
  119. #define DV_E_FORMATETC              (DVGEN_E_FIRST)
  120. // invalid FORMATETC structure
  121.  
  122. #define DV_E_DVTARGETDEVICE         (DVGEN_E_FIRST+1)
  123. // invalid DVTARGETDEVICE structure
  124.  
  125. #define DV_E_STGMEDIUM              (DVGEN_E_FIRST+2)
  126. // invalid STDGMEDIUM structure
  127.  
  128. #define DV_E_STATDATA               (DVGEN_E_FIRST+3)
  129. // invalid STATDATA structure
  130.  
  131. #define DV_E_LINDEX                 (DVGEN_E_FIRST+4)
  132. // invalid lindex
  133.  
  134. #define DV_E_TYMED                  (DVGEN_E_FIRST+5)
  135. // invalid tymed
  136.  
  137. #define DV_E_CLIPFORMAT             (DVGEN_E_FIRST+6)
  138. // invalid clipboard format
  139.  
  140. #define DV_E_DVASPECT               (DVGEN_E_FIRST+7)
  141. // invalid aspect(s) 
  142.  
  143. #define DV_E_DVTARGETDEVICE_SIZE    (DVGEN_E_FIRST+8)
  144. // tdSize paramter of the DVTARGETDEVICE structure is invalid
  145.  
  146. #define DV_E_NOIVIEWOBJECT          (DVGEN_E_FIRST+9)
  147. // object doesn't support IViewObject interface
  148.  
  149.  
  150. // Success codes
  151.  
  152. #define OLE_S_USEREG                (OLE_S_FIRST)
  153. // use the reg database to provide the requested info
  154.  
  155. #define OLE_S_STATIC                (OLE_S_FIRST+1)
  156. // success, but static 
  157.  
  158. #define OLE_S_MAC_CLIPFORMAT        (OLE_S_FIRST+2)
  159. // macintosh clipboard format
  160.  
  161. #define OLE_S_WIN_CLIPFORMAT        (OLE_S_FIRST+3)
  162. // macintosh clipboard format
  163.  
  164. //*************************** Interface or API specific scodes *************
  165.  
  166. // Errors for OleConvertOLESTREAMToIStorage and OleConvertIStorageToOLESTREAM
  167.  
  168. // OLESTREAM Get method failed
  169. #define CONVERT10_E_OLESTREAM_GET       (CONVERT10_E_FIRST + 0)
  170.  
  171. // OLESTREAM Put method failed
  172. #define CONVERT10_E_OLESTREAM_PUT       (CONVERT10_E_FIRST + 1)
  173.  
  174. // Contents of the OLESTREAM not in correct format
  175. #define CONVERT10_E_OLESTREAM_FMT       (CONVERT10_E_FIRST + 2)
  176.  
  177. // There was in an error in a Windows GDI call while converting the bitmap
  178. // to a DIB.
  179. #define CONVERT10_E_OLESTREAM_BITMAP_TO_DIB (CONVERT10_E_FIRST + 3)
  180.  
  181. // Contents of the IStorage not in correct format
  182. #define CONVERT10_E_STG_FMT             (CONVERT10_E_FIRST + 4)
  183.  
  184. // Contents of IStorage is missing one of the standard streams ("\1CompObj", 
  185. // "\1Ole", "\2OlePres000").  This may be the storage for a DLL object, or a
  186. // class that does not use the def handler.
  187. #define CONVERT10_E_STG_NO_STD_STREAM   (CONVERT10_E_FIRST + 5)
  188.  
  189. // There was in an error in a Windows GDI call while converting the DIB
  190. // to a bitmap.
  191. #define CONVERT10_E_STG_DIB_TO_BITMAP   (CONVERT10_E_FIRST + 6)
  192.  
  193.  
  194. // Returned by either API, this scode indicates that the original object
  195. //  had no presentation, therefore the converted object does not either.
  196. #define CONVERT10_S_NO_PRESENTATION     (CONVERT10_S_FIRST + 0)
  197.  
  198.  
  199. // Errors for Clipboard functions
  200.  
  201. // OpenClipboard Failed
  202. #define CLIPBRD_E_CANT_OPEN     (CLIPBRD_E_FIRST + 0)
  203.  
  204. // EmptyClipboard Failed
  205. #define CLIPBRD_E_CANT_EMPTY        (CLIPBRD_E_FIRST + 1)
  206.  
  207. // SetClipboard Failed
  208. #define CLIPBRD_E_CANT_SET          (CLIPBRD_E_FIRST + 2)
  209.  
  210. // Data on clipboard is invalid
  211. #define CLIPBRD_E_BAD_DATA          (CLIPBRD_E_FIRST + 3)
  212.  
  213. // CloseClipboard Failed
  214. #define CLIPBRD_E_CANT_CLOSE        (CLIPBRD_E_FIRST + 4)
  215.  
  216.  
  217. /****** OLE value types *****************************************************/
  218.  
  219. /* rendering options */
  220. typedef enum tagOLERENDER
  221. {
  222.     OLERENDER_NONE   = 0, 
  223.     OLERENDER_DRAW   = 1, 
  224.     OLERENDER_FORMAT = 2,
  225.     OLERENDER_ASIS   = 3
  226.  
  227.     ,OLERENDER_FORCELONG    =    2147483647
  228. } OLERENDER;
  229. typedef  OLERENDER * LPOLERENDER;
  230.  
  231. // OLE verb; returned by IEnumOLEVERB
  232. typedef struct FARSTRUCT tagOLEVERB
  233. {
  234.     long    lVerb;
  235.     char *   lpszVerbName;
  236.     unsigned long   fuFlags;
  237.     unsigned long grfAttribs;
  238. } OLEVERB, * LPOLEVERB;
  239.  
  240.  
  241. // Bitwise verb attributes used in OLEVERB.grfAttribs
  242. typedef enum tagOLEVERBATTRIB // bitwise
  243. {
  244.     OLEVERBATTRIB_NEVERDIRTIES = 1,
  245.     OLEVERBATTRIB_ONCONTAINERMENU = 2
  246.  
  247.     ,OLEVERBATTRIB_FORCELONG    =    2147483647
  248. } OLEVERBATTRIB;
  249.  
  250.  
  251. // IOleObject::GetUserType optons; determines which form of the string to use
  252. typedef enum tagUSERCLASSTYPE
  253. {
  254.     USERCLASSTYPE_FULL = 1,
  255.     USERCLASSTYPE_SHORT= 2,
  256.     USERCLASSTYPE_APPNAME= 3
  257.     ,USERCLASSTYPE_FORCELONG    =    2147483647
  258. } USERCLASSTYPE;
  259.  
  260.  
  261. // bits returned from IOleObject::GetMistStatus
  262. typedef enum tagOLEMISC // bitwise
  263. {
  264.     OLEMISC_RECOMPOSEONRESIZE = 1,
  265.     OLEMISC_ONLYICONIC        = 2,
  266.     OLEMISC_INSERTNOTREPLACE  = 4,
  267.     OLEMISC_STATIC            = 8,
  268.     OLEMISC_CANTLINKINSIDE    = 16,
  269.     OLEMISC_CANLINKBYOLE1       = 32,
  270.     OLEMISC_ISLINKOBJECT        = 64,
  271.     OLEMISC_INSIDEOUT           = 128,
  272.     OLEMISC_ACTIVATEWHENVISIBLE = 256       
  273.     ,OLEMISC_FORCELONG    =    2147483647
  274. } OLEMISC;
  275.  
  276.  
  277. // IOleObject::Close options
  278. typedef enum tagOLECLOSE
  279. {
  280.     OLECLOSE_SAVEIFDIRTY = 0,
  281.     OLECLOSE_NOSAVE      = 1,
  282.     OLECLOSE_PROMPTSAVE  = 2
  283.     ,OLECLOSE_FORCELONG    =    2147483647
  284. } OLECLOSE;
  285.  
  286.  
  287. // IOleObject::GetMoniker and IOleClientSite::GetMoniker options; determines
  288. // if and how monikers should be assigned.
  289. typedef enum tagOLEGETMONIKER
  290. {
  291.     OLEGETMONIKER_ONLYIFTHERE=1,
  292.     OLEGETMONIKER_FORCEASSIGN=2,
  293.     OLEGETMONIKER_UNASSIGN=3,
  294.     OLEGETMONIKER_TEMPFORUSER=4 
  295.     ,OLEGETMONIKER_FORCELONG    =    2147483647
  296. } OLEGETMONIKER;
  297.  
  298.  
  299. // IOleObject::GetMoniker, IOleObject::SetMoniker and 
  300. // IOleClientSite::GetMoniker options; determines which moniker to use
  301. typedef enum tagOLEWHICHMK
  302. {
  303.     OLEWHICHMK_CONTAINER=1,
  304.     OLEWHICHMK_OBJREL=2,
  305.     OLEWHICHMK_OBJFULL=3
  306.     ,OLEWHICHMK_FORCELONG    =    2147483647
  307. } OLEWHICHMK;
  308.  
  309.  
  310.  
  311. #ifndef _WINDEF_
  312.  
  313. typedef struct FARSTRUCT tagSIZEL
  314. {
  315.     long cx;
  316.     long cy;
  317. } SIZEL;
  318.  
  319. typedef struct FARSTRUCT tagRECTL
  320. {
  321.     long    left;
  322.     long    top;
  323.     long    right;
  324.     long    bottom;
  325. } RECTL;
  326.  
  327. typedef struct FARSTRUCT tagPOINTL {
  328.     long x;
  329.     long y;
  330. } POINTL;
  331.  
  332. #endif
  333.  
  334. typedef SIZEL * LPSIZEL;
  335. typedef RECTL * LPRECTL;
  336.  
  337.  
  338.  
  339. #ifndef LPCRECT
  340. typedef const Rect * LPCRECT;
  341. #endif
  342.  
  343. #ifndef LPCRECTL
  344. typedef const RECTL * LPCRECTL;
  345. #endif
  346.  
  347. // for OleCreateEmbeddingHelper flags; roles in low word; options in high word
  348. #define EMBDHLP_INPROC_HANDLER   0x0000L // role is handler; implementation is 
  349.                                          // default handler; pCF can be NULL
  350. #define EMBDHLP_INPROC_SERVER    0x0001L // role is server; pCF can't be NULL
  351.  
  352. #define EMBDHLP_CREATENOW    0x00000000L // create using pCF immediately; if pCF
  353.                                          // is NULL, uses std remoting handler
  354. #define EMBDHLP_DELAYCREATE  0x00010000L // delayed create; must supply pCF
  355.  
  356.  
  357. // NOTE: OleCreateEmbeddingHelper(clsid, pUnkOuter, 
  358. //         EMBDHLP_INPROC_HANDLER | EMBDHLP_CREATENOW, NULL, riid, lplpObj) 
  359. // is the same as OleCreateDefaultHandler(clsid, pUnkOuter, riid, lplpObj);
  360. // i.e., the embedding helper is the default handler in various roles.
  361.  
  362.  
  363. /***** OLE 1.0 OLESTREAM declarations *************************************/
  364.  
  365. typedef struct _OLESTREAM *  LPOLESTREAM;
  366.  
  367. typedef struct _OLESTREAMVTBL
  368. {
  369. #ifndef _MSC_VER
  370.     pascal unsigned long (* Get)(LPOLESTREAM, void *, unsigned long);
  371.     pascal unsigned long (* Put)(LPOLESTREAM, const void *, unsigned long);
  372. #else
  373.     unsigned long ( __pascal * Get)(LPOLESTREAM, void *, unsigned long);
  374.     unsigned long ( __pascal * Put)(LPOLESTREAM, const void *, unsigned long);
  375. #endif
  376. } OLESTREAMVTBL;
  377. typedef  OLESTREAMVTBL *  LPOLESTREAMVTBL;
  378.  
  379. typedef struct _OLESTREAM
  380. {
  381.     LPOLESTREAMVTBL lpstbl;
  382. } OLESTREAM;
  383.  
  384.  
  385. /****** Clipboard Data structures *****************************************/
  386.  
  387. typedef struct tagOBJECTDESCRIPTOR
  388. {
  389.     unsigned long    cbSize;             // Size of structure in bytes
  390.     CLSID            clsid;                // CLSID of data being transferred
  391.     unsigned long    dwDrawAspect;          // Display aspect of the object
  392.                                         //     normally DVASPECT_CONTENT or ICON.
  393.                                         //     dwDrawAspect will be 0 (which is NOT
  394.                                         //     DVASPECT_CONTENT) if the copier or 
  395.                                         //     dragsource didn't draw the object to 
  396.                                         //     begin with.
  397.     SIZEL            sizel;               // size of the object in HIMETRIC
  398.                                         //    sizel is opt.: will be (0,0) for apps
  399.                                         //    which don't draw the object being
  400.                                         //    transferred
  401.     unsigned long    dwOutline;            // Offset from beginning of structure to
  402.                                         //    Region describing outline of object
  403.                                         //    Like sizel, this is only defined for
  404.                                         //    drawable objects, else it is zero.
  405.                                         //      To turn this data at this offset into
  406.                                         //      a region handle, allocate a handle
  407.                                         //    the size of the first word of the region data
  408.                                         //      and then copy those n bytes into the handle
  409.                                         //      (including the first word)
  410.                                         //            char *p = ((char*) pOD) + pOD->dwOutline; // ptr to region data
  411.                                         //            short size = *(short *) p;
  412.                                         //            h = NewHandle(size);
  413.                                         //            BlockMove(p, *h, size);
  414.     POINTL           pointl;                // Offset in HIMETRIC units from the
  415.                                         //    upper-left corner of the obj where the
  416.                                         //    mouse went down for the drag.
  417.                                         //    NOTE: y coordinates increase downward.
  418.                                         //          x coordinates increase to right
  419.                                         //    pointl is opt.; it is only meaningful 
  420.                                         //    if object is transfered via drag/drop.
  421.                                          //    (0, 0) if mouse position is unspecified
  422.                                         //    (eg. when obj transfered via clipboard)
  423.     unsigned long    dwStatus;             // Misc. status flags for object. Flags are 
  424.                                          //    defined by OLEMISC enum. these flags 
  425.                                         //    are as would be returned
  426.                                          //    by IOleObject::GetMiscStatus.
  427.     unsigned long    dwFullUserTypeName;    // Offset from beginning of structure to 
  428.                                         //    null-terminated string that specifies 
  429.                                         //    Full User Type Name of the object. 
  430.                                         //    0 indicates string not present.
  431.     unsigned long    dwSrcOfCopy;           // Offset from beginning of structure to 
  432.                                         //    null-terminated string that specifies
  433.                                         //    source of the transfer. 
  434.                                         //    dwSrcOfCOpy is normally implemented as 
  435.                                         //    the display name of the temp-for-user 
  436.                                         //    moniker which identifies the source of 
  437.                                         //    the data. 
  438.                                         //    0 indicates string not present.
  439.                                         //    NOTE: moniker assignment is NOT forced.
  440.                                         //    see IOleObject::GetMoniker(
  441.                                         //                OLEGETMONIKER_TEMPFORUSER)
  442.     unsigned long    dwExtra;            // must be null
  443.  /* variable sized string data may appear here */
  444.  
  445. } OBJECTDESCRIPTOR,  *POBJECTDESCRIPTOR,   *LPOBJECTDESCRIPTOR,
  446.   LINKSRCDESCRIPTOR, *PLINKSRCDESCRIPTOR,  *LPLINKSRCDESCRIPTOR;
  447.  
  448.  
  449.  
  450. /* verbs */
  451. #define OLEIVERB_PRIMARY     (0L)
  452. #define OLEIVERB_SHOW        (-1L)
  453. #define OLEIVERB_OPEN        (-2L)
  454. #define OLEIVERB_HIDE        (-3L)
  455. #define OLEIVERB_UIACTIVATE         (-4L)
  456. #define OLEIVERB_INPLACEACTIVATE    (-5L)
  457. #define OLEIVERB_DISCARDUNDOSTATE   (-6L)
  458.  
  459.  
  460. //      forward type declarations
  461. #if defined(__cplusplus)
  462. interface IOleClientSite;
  463. interface IOleContainer;
  464. interface IOleObject;
  465. #else 
  466. //typedef interface IOleClientSite IOleClientSite;
  467. //typedef interface IOleContainer IOleContainer;
  468. //typedef interface IOleObject IOleObject;
  469. #endif
  470.  
  471. typedef   interface IOleObject * LPOLEOBJECT, ** LPLPOLEOBJECT;
  472. typedef   interface IOleClientSite * LPOLECLIENTSITE, ** LPLPOLECLIENTSITE;
  473. typedef   interface IOleContainer * LPOLECONTAINER, ** LPLPOLECONTAINER;
  474.  
  475.  
  476. /****** OLE GUIDs *********************************************************/
  477.  
  478. #ifndef INITGUID
  479. #include "oleguid.h"
  480. #endif
  481.  
  482.  
  483. /****** Other Major Interfaces ********************************************/
  484.  
  485. #ifndef __DVOBJ__
  486. #include <dvobj.h>
  487. #endif
  488.  
  489. #ifndef __STORAGE__
  490. #include <storage.h>
  491. #endif
  492.  
  493.  
  494.  
  495. /****** IDrop??? Interfaces ********************************************/
  496.  
  497.  
  498.  
  499. #define DROPEFFECT_NONE     0
  500. #define DROPEFFECT_COPY     1
  501. #define DROPEFFECT_MOVE     2
  502. #define DROPEFFECT_LINK     4
  503. #define DROPEFFECT_SCROLL   0x80000000
  504.  
  505. // default inset-width of the hot zone, in pixels
  506. #define DD_DEFSCROLLINSET 15
  507.  
  508. // default delay before scrolling, in ticks (sixtieths of a second)
  509. // Better is to use GetDblTime()
  510. #define DD_DEFSCROLLDELAY        10
  511.  
  512. // default scroll interval, in ticks
  513. #define DD_DEFSCROLLINTERVAL    2
  514.  
  515. // default delay before dragging should start, in ticks
  516. #define DD_DEFDRAGDELAY         10
  517.  
  518. // default minimum distance (radius) before dragging should start, in pixels
  519. #define DD_DEFDRAGMINDIST        2
  520.  
  521.  
  522.  
  523. /* Dragdrop specific error codes */
  524.  
  525. #define    DRAGDROP_E_NOTREGISTERED        (DRAGDROP_E_FIRST)
  526. // trying to revoke a drop target that has not been registered 
  527.  
  528. #define    DRAGDROP_E_ALREADYREGISTERED    (DRAGDROP_E_FIRST+1)
  529. // this window has already been registered as a drop target
  530.  
  531. #define DRAGDROP_E_INVALIDHWND            (DRAGDROP_E_FIRST+2)
  532. // invalid Handle
  533.  
  534.  
  535. #define DRAGDROP_S_DROP                 (DRAGDROP_S_FIRST + 0)
  536. // successful drop took place 
  537.  
  538. #define DRAGDROP_S_CANCEL               (DRAGDROP_S_FIRST + 1)
  539. // drag-drop operation canceled
  540.  
  541. #define DRAGDROP_S_USEDEFAULTCURSORS    (DRAGDROP_S_FIRST + 2)
  542. // use the default cursor
  543.  
  544.  
  545. #undef INTERFACE
  546. #define INTERFACE   IDropTarget
  547.  
  548.  
  549. DECLARE_INTERFACE_(IDropTarget, IUnknown)
  550. {
  551.     BEGIN_INTERFACE
  552.     // *** IUnknown methods ***
  553.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  554.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  555.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  556.  
  557.     // *** IDropTarget methods ***
  558.     STDMETHOD(DragEnter) (THIS_ LPDATAOBJECT pDataObj, 
  559.                 unsigned long grfKeyState, POINTL pt, 
  560.                 unsigned long    * pdwEffect) PURE;
  561.     STDMETHOD(DragOver) (THIS_ unsigned long grfKeyState, POINTL pt, unsigned long    * pdwEffect) PURE;
  562.     STDMETHOD(DragLeave) (THIS) PURE;
  563.     STDMETHOD(Drop) (THIS_ LPDATAOBJECT pDataObj, unsigned long grfKeyState, POINTL pt, unsigned long    * pdwEffect) PURE;
  564. };
  565. typedef         IDropTarget * LPDROPTARGET, ** LPLPDROPTARGET;
  566.  
  567.  
  568.  
  569. #undef INTERFACE
  570. #define INTERFACE   IDropSource
  571.  
  572. DECLARE_INTERFACE_(IDropSource, IUnknown)
  573. {
  574.     BEGIN_INTERFACE
  575.     // *** IUnknown methods ***
  576.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  577.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  578.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  579.  
  580.     // *** IDropSource methods ***
  581.     STDMETHOD(QueryContinueDrag) (THIS_ unsigned long fEscapePressed, unsigned long grfKeyState) PURE;
  582.     STDMETHOD(GiveFeedback) (THIS_ unsigned long dwEffect) PURE;
  583. };
  584. typedef         IDropSource * LPDROPSOURCE, ** LPLPDROPSOURCE;
  585.  
  586.  
  587.  
  588. /****** IPersist??? Interfaces ********************************************/
  589.  
  590.  
  591. #undef INTERFACE
  592. #define INTERFACE   IPersist
  593.  
  594. DECLARE_INTERFACE_(IPersist, IUnknown)
  595. {
  596.     BEGIN_INTERFACE
  597.     // *** IUnknown methods ***
  598.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  599.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  600.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  601.  
  602.     // *** IPersist methods ***
  603.     STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  604. };
  605. typedef            IPersist * LPPERSIST, ** LPLPPERSIST;
  606.  
  607.  
  608.  
  609. #undef INTERFACE
  610. #define INTERFACE   IPersistStorage
  611.  
  612. DECLARE_INTERFACE_(IPersistStorage, IPersist)
  613. {
  614.     BEGIN_INTERFACE
  615.     // *** IUnknown methods ***
  616.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  617.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  618.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  619.  
  620.     // *** IPersist methods ***
  621.     STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  622.  
  623.     // *** IPersistStorage methods ***
  624.     STDMETHOD(IsDirty) (THIS) PURE;
  625.     STDMETHOD(InitNew) (THIS_ LPSTORAGE pStg) PURE;
  626.     STDMETHOD(Load) (THIS_ LPSTORAGE pStg) PURE;
  627.     STDMETHOD(Save) (THIS_ LPSTORAGE pStgSave, unsigned long fSameAsLoad) PURE;
  628.     STDMETHOD(SaveCompleted) (THIS_ LPSTORAGE pStgNew) PURE;
  629.     STDMETHOD(HandsOffStorage) (THIS) PURE; 
  630. };
  631. typedef         IPersistStorage * LPPERSISTSTORAGE, ** LPLPPERSISTSTORAGE;
  632.  
  633.  
  634.  
  635. #undef INTERFACE
  636. #define INTERFACE   IPersistStream
  637.  
  638. DECLARE_INTERFACE_(IPersistStream, IPersist)
  639. {
  640.     BEGIN_INTERFACE
  641.     // *** IUnknown methods ***
  642.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  643.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  644.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  645.  
  646.     // *** IPersist methods ***
  647.     STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  648.  
  649.     // *** IPersistStream methods ***
  650.     STDMETHOD(IsDirty) (THIS) PURE;
  651.     STDMETHOD(Load) (THIS_ LPSTREAM pStm) PURE;
  652.     STDMETHOD(Save) (THIS_ LPSTREAM pStm,
  653.                     unsigned long fClearDirty) PURE;
  654.     STDMETHOD(GetSizeMax) (THIS_ ULARGE_INTEGER  * pcbSize) PURE;
  655. };
  656. typedef          IPersistStream * LPPERSISTSTREAM, ** LPLPPERSISTSTREAM;
  657.  
  658.  
  659.  
  660. #undef INTERFACE
  661. #define INTERFACE   IPersistFile
  662.  
  663. DECLARE_INTERFACE_(IPersistFile, IPersist)
  664. {
  665.     BEGIN_INTERFACE
  666.     // *** IUnknown methods ***
  667.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  668.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  669.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  670.     
  671.     // *** IPersist methods ***
  672.     STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  673.     
  674.     // *** IPersistFile methods ***
  675.     STDMETHOD(IsDirty) (THIS) PURE;
  676.     STDMETHOD(Load) (THIS_ const char * lpszFileName, unsigned long grfMode) PURE;
  677.     STDMETHOD(Save) (THIS_ const char * lpszFileName, unsigned long fRemember) PURE;
  678.     STDMETHOD(SaveCompleted) (THIS_ const char * lpszFileName) PURE;
  679.     STDMETHOD(GetCurFile) (THIS_ char *  * lplpszFileName) PURE;
  680.  
  681.      STDMETHOD(LoadFSP) (THIS_ const FSSpec *pFSSpec, unsigned long grfMode) PURE;
  682.     STDMETHOD(SaveFSP) (THIS_ const FSSpec *pFSSpec, unsigned long fRemember) PURE;
  683.     STDMETHOD(SaveCompletedFSP) (THIS_ const FSSpec *pFSSpec) PURE;
  684.     STDMETHOD(GetCurFSP) (THIS_ FSSpec *pFSSpec) PURE; 
  685. };
  686. typedef            IPersistFile * LPPERSISTFILE, ** LPLPPERSISTFILE;
  687.  
  688.   
  689. /****** Moniker Object Interfaces ******************************************/
  690.  
  691. #ifndef __MONIKER__
  692. #include <moniker.h>
  693. #endif
  694.  
  695.  
  696. /****** OLE Object Interfaces ******************************************/
  697.   
  698.  
  699. #undef  INTERFACE
  700. #define INTERFACE   IEnumOLEVERB
  701.  
  702. DECLARE_INTERFACE_(IEnumOLEVERB, IUnknown)
  703. {
  704.     BEGIN_INTERFACE
  705.     // *** IUnknown methods ***
  706.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  707.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  708.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  709.  
  710.     // *** IEnumOLEVERB methods ***
  711.     STDMETHOD(Next) (THIS_ unsigned long celt, LPOLEVERB rgelt, unsigned long * pceltFetched) PURE;
  712.     STDMETHOD(Skip) (THIS_ unsigned long celt) PURE;
  713.     STDMETHOD(Reset) (THIS) PURE;
  714.     STDMETHOD(Clone) (THIS_ IEnumOLEVERB * * ppenm) PURE;
  715. };
  716. typedef         IEnumOLEVERB * LPENUMOLEVERB, ** LPLPENUMOLEVERB;
  717.  
  718.  
  719.  
  720.  
  721. #undef  INTERFACE
  722. #define INTERFACE   IOleObject
  723.  
  724. #define OLEOBJ_E_NOVERBS                (OLEOBJ_E_FIRST + 0)
  725.  
  726. #define OLEOBJ_E_INVALIDVERB            (OLEOBJ_E_FIRST + 1)
  727.  
  728. #define OLEOBJ_S_INVALIDVERB            (OLEOBJ_S_FIRST + 0)
  729.  
  730. #define OLEOBJ_S_CANNOT_DOVERB_NOW      (OLEOBJ_S_FIRST + 1)
  731. // verb number is valid but verb cannot be done now, for instance
  732. // hiding a link or hiding a visible OLE 1.0 server
  733.  
  734. #define OLEOBJ_S_INVALIDHWND            (OLEOBJ_S_FIRST + 2)
  735. // invalid hwnd passed
  736.  
  737.  
  738. DECLARE_INTERFACE_(IOleObject, IUnknown)
  739. {
  740.     BEGIN_INTERFACE
  741.     // *** IUnknown methods ***
  742.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  743.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  744.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  745.  
  746.     // *** IOleObject methods ***
  747.     STDMETHOD(SetClientSite) (THIS_ LPOLECLIENTSITE pClientSite) PURE;
  748.     STDMETHOD(GetClientSite) (THIS_ LPLPOLECLIENTSITE ppClientSite) PURE;
  749.     STDMETHOD(SetHostNames) (THIS_ const char * szContainerApp, const char * szContainerObj) PURE;
  750.     STDMETHOD(Close) (THIS_ unsigned long dwSaveOption) PURE;
  751.     STDMETHOD(SetMoniker) (THIS_ unsigned long dwWhichMoniker, LPMONIKER pmk) PURE;
  752.     STDMETHOD(GetMoniker) (THIS_ unsigned long dwAssign, unsigned long dwWhichMoniker, 
  753.                 LPLPMONIKER ppmk) PURE;
  754.     STDMETHOD(InitFromData) (THIS_ LPDATAOBJECT pDataObject,
  755.                 unsigned long fCreation,
  756.                 unsigned long dwReserved) PURE;
  757.     STDMETHOD(GetClipboardData) (THIS_ unsigned long dwReserved, 
  758.                 LPLPDATAOBJECT ppDataObject) PURE;
  759.     STDMETHOD(DoVerb) (THIS_ long iVerb,
  760.                 EventRecord * pEvt, 
  761.                 LPOLECLIENTSITE pActiveSite, 
  762.                 long lindex,
  763.                 WindowPtr pWndParent,
  764.                 LPCRECT lprcPosRect) PURE;
  765.     STDMETHOD(EnumVerbs) (THIS_ LPLPENUMOLEVERB ppenumOleVerb) PURE;
  766.     STDMETHOD(Update) (THIS) PURE;
  767.     STDMETHOD(IsUpToDate) (THIS) PURE;
  768.     STDMETHOD(GetUserClassID) (THIS_ CLSID * pClsid) PURE;
  769.     STDMETHOD(GetUserType) (THIS_ unsigned long dwFormOfType, char * * pszUserType) PURE;
  770.     STDMETHOD(SetExtent) (THIS_ unsigned long dwDrawAspect, LPSIZEL lpsizel) PURE;
  771.     STDMETHOD(GetExtent) (THIS_ unsigned long dwDrawAspect, LPSIZEL lpsizel) PURE;
  772.     STDMETHOD(Advise)(THIS_ LPADVISESINK pAdvSink, unsigned long * pdwConnection) PURE;
  773.     STDMETHOD(Unadvise)(THIS_ unsigned long dwConnection) PURE;
  774.     STDMETHOD(EnumAdvise) (THIS_ LPLPENUMSTATDATA ppenumAdvise) PURE;
  775.     STDMETHOD(GetMiscStatus) (THIS_ unsigned long dwAspect, unsigned long * pdwStatus) PURE;
  776.     STDMETHOD(SetColorScheme) (THIS_ LPOLECOLORSCHEME lpColorScheme) PURE;
  777. };
  778. // MAC Think C support
  779. //typedef      IOleObject * LPOLEOBJECT, ** LPLPOLEOBJECT;
  780.  
  781.  
  782.  
  783. #undef  INTERFACE
  784. #define INTERFACE   IOleClientSite
  785.  
  786. DECLARE_INTERFACE_(IOleClientSite, IUnknown)
  787. {
  788.     BEGIN_INTERFACE
  789.     // *** IUnknown methods ***
  790.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  791.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  792.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  793.  
  794.     // *** IOleClientSite methods ***
  795.     STDMETHOD(SaveObject) (THIS) PURE;
  796.     STDMETHOD(GetMoniker) (THIS_ unsigned long dwAssign, unsigned long dwWhichMoniker, 
  797.                 LPLPMONIKER ppmk) PURE;
  798.     STDMETHOD(GetContainer) (THIS_ LPLPOLECONTAINER ppContainer) PURE;   
  799.     STDMETHOD(ShowObject) (THIS) PURE;  
  800.     STDMETHOD(OnShowWindow) (THIS_ unsigned long fShow) PURE;    
  801.     STDMETHOD(RequestNewObjectLayout) (THIS) PURE;      
  802. };
  803. // MAC Think C support
  804. //typedef      IOleClientSite * LPOLECLIENTSITE, ** LPLPOLECLIENTSITE;
  805.  
  806. /****** OLE Runnable Object Interface **********************************/
  807.  
  808. #undef  INTERFACE
  809. #define INTERFACE    IRunnableObject
  810.  
  811. DECLARE_INTERFACE_(IRunnableObject, IUnknown)
  812. {
  813.     BEGIN_INTERFACE
  814.     // *** IUnknown methods ***
  815.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  816.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  817.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  818.  
  819.     // *** IRunnableObject methods ***
  820.     STDMETHOD(GetRunningClass) (THIS_ LPCLSID lpClsid) PURE;
  821.     STDMETHOD(Run) (THIS_ LPBINDCTX pbc) PURE;
  822.     STDMETHOD_(unsigned long, IsRunning) (THIS) PURE;
  823.     STDMETHOD(LockRunning)(THIS_ unsigned long fLock, unsigned long fLastUnlockCloses) PURE;
  824.     STDMETHOD(SetContainedObject)(THIS_ unsigned long fContained) PURE;
  825. };
  826. typedef      IRunnableObject * LPRUNNABLEOBJECT, ** LPLPRUNNABLEOBJECT;
  827.  
  828.  
  829. /****** OLE Container Interfaces ***************************************/
  830.  
  831.  
  832. #undef  INTERFACE
  833. #define INTERFACE   IParseDisplayName
  834.  
  835. DECLARE_INTERFACE_(IParseDisplayName, IUnknown)
  836. {
  837.     BEGIN_INTERFACE
  838.     // *** IUnknown methods ***
  839.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  840.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  841.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  842.  
  843.     // *** IParseDisplayName method ***
  844.     STDMETHOD(ParseDisplayName) (THIS_ LPBC pbc, char * lpszDisplayName,
  845.         unsigned long * pchEaten, LPLPMONIKER ppmkOut) PURE;
  846. };
  847. typedef       IParseDisplayName * LPPARSEDISPLAYNAME, ** LPLPPARSEDISPLAYNAME;
  848.  
  849.  
  850. #undef  INTERFACE
  851. #define INTERFACE   IOleContainer
  852.  
  853. DECLARE_INTERFACE_(IOleContainer, IParseDisplayName)
  854.     BEGIN_INTERFACE
  855.     // *** IUnknown methods ***
  856.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  857.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  858.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  859.  
  860.     // *** IParseDisplayName method ***
  861.     STDMETHOD(ParseDisplayName) (THIS_ LPBC pbc, char * lpszDisplayName,
  862.         unsigned long * pchEaten, LPLPMONIKER ppmkOut) PURE;
  863.  
  864.     // *** IOleContainer methods ***
  865.     STDMETHOD(EnumObjects) ( THIS_ unsigned long grfFlags, LPLPENUMUNKNOWN ppenumUnknown) PURE;
  866.     STDMETHOD(LockContainer) (THIS_ unsigned long fLock) PURE;   
  867. };
  868. //typedef IOleContainer * LPOLECONTAINER, ** LPLPOLECONTAINER;
  869.  
  870.  
  871. typedef enum tagBINDSPEED
  872. {
  873.     BINDSPEED_INDEFINITE    = 1,
  874.     BINDSPEED_MODERATE      = 2,
  875.     BINDSPEED_IMMEDIATE     = 3
  876.     ,BINDSPEED_FORCELONG    =    2147483647
  877. } BINDSPEED;
  878.  
  879. typedef enum tagOLECONTF
  880. {
  881.     OLECONTF_EMBEDDINGS        =  1,
  882.     OLECONTF_LINKS             =  2,
  883.     OLECONTF_OTHERS         =  4,
  884.     OLECONTF_ONLYUSER         =  8,
  885.     OLECONTF_ONLYIFRUNNING     = 16
  886.     ,OLECONTF_FORCELONG    =    2147483647
  887. } OLECONTF;
  888.  
  889.  
  890. #undef  INTERFACE
  891. #define INTERFACE   IOleItemContainer
  892.  
  893. DECLARE_INTERFACE_(IOleItemContainer, IOleContainer)
  894.     BEGIN_INTERFACE
  895.     // *** IUnknown methods ***
  896.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  897.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  898.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  899.  
  900.     // *** IParseDisplayName method ***
  901.     STDMETHOD(ParseDisplayName) (THIS_ LPBC pbc, char * lpszDisplayName,
  902.         unsigned long * pchEaten, LPLPMONIKER ppmkOut) PURE;
  903.  
  904.     // *** IOleContainer methods ***
  905.     STDMETHOD(EnumObjects) (THIS_ unsigned long grfFlags, LPLPENUMUNKNOWN ppenumUnknown) PURE;
  906.     STDMETHOD(LockContainer) (THIS_ unsigned long fLock) PURE;   
  907.     
  908.     // *** IOleItemContainer methods ***
  909.     STDMETHOD(GetObject) (THIS_ char * lpszItem, unsigned long dwSpeedNeeded,
  910.         LPBINDCTX pbc, REFIID riid, void * * ppvObject) PURE;
  911.     STDMETHOD(GetObjectStorage) (THIS_ char * lpszItem, LPBINDCTX pbc,
  912.         REFIID riid, void * * ppvStorage) PURE;
  913.     STDMETHOD(IsRunning) (THIS_ char * lpszItem) PURE;
  914. };
  915. typedef       IOleItemContainer * LPOLEITEMCONTAINER, ** LPLPOLEITEMCONTAINER;
  916.  
  917.  
  918. /****** OLE Advise Holder Interface ***************************************/
  919.  
  920.  
  921. #undef  INTERFACE
  922. #define INTERFACE   IOleAdviseHolder
  923.  
  924. DECLARE_INTERFACE_(IOleAdviseHolder, IUnknown)
  925.     BEGIN_INTERFACE
  926.     // *** IUnknown methods ***
  927.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppv) PURE;
  928.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  929.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  930.  
  931.     // *** IOleAdviseHolder methods ***
  932.     STDMETHOD(Advise)(THIS_ LPADVISESINK pAdvise, unsigned long * pdwConnection) PURE;
  933.     STDMETHOD(Unadvise)(THIS_ unsigned long dwConnection) PURE;
  934.     STDMETHOD(EnumAdvise)(THIS_ LPLPENUMSTATDATA ppenumAdvise) PURE;
  935.  
  936.     STDMETHOD(SendOnRename)(THIS_ LPMONIKER pmk) PURE;
  937.     STDMETHOD(SendOnSave)(THIS) PURE;
  938.     STDMETHOD(SendOnClose)(THIS) PURE;
  939. };
  940. typedef      IOleAdviseHolder * LPOLEADVISEHOLDER, ** LPLPOLEADVISEHOLDER;
  941.  
  942.  
  943. /****** OLE Link Interface ************************************************/
  944.  
  945. /* Link update options */
  946. typedef enum tagOLEUPDATE
  947. {
  948.     OLEUPDATE_ALWAYS=1,
  949.     OLEUPDATE_ONCALL=3
  950.     ,OLEUPDATE_FORCELONG    =    2147483647
  951. } OLEUPDATE;
  952. typedef  OLEUPDATE * LPOLEUPDATE;
  953.  
  954.  
  955. // for IOleLink::BindToSource
  956. typedef enum tagOLELINKBIND
  957. {
  958.     OLELINKBIND_EVENIFCLASSDIFF = 1
  959.     ,OLELINKBIND_FORCELONG    =    2147483647
  960. } OLELINKBIND;
  961.  
  962.  
  963. #undef  INTERFACE
  964. #define INTERFACE   IOleLink
  965.  
  966. DECLARE_INTERFACE_(IOleLink, IUnknown)
  967. {
  968.     BEGIN_INTERFACE
  969.     // *** IUnknown methods ***
  970.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  971.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  972.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  973.  
  974.     // *** IOleLink methods ***
  975.     STDMETHOD(SetUpdateOptions) (THIS_ unsigned long dwUpdateOpt) PURE;
  976.     STDMETHOD(GetUpdateOptions) (THIS_ unsigned long    * pdwUpdateOpt) PURE;
  977.     STDMETHOD(SetSourceMoniker) (THIS_ LPMONIKER pmk, REFCLSID rclsid) PURE;
  978.     STDMETHOD(GetSourceMoniker) (THIS_ LPLPMONIKER ppmk) PURE;
  979.     STDMETHOD(SetSourceDisplayName) (THIS_ const char * lpszDisplayName) PURE;
  980.     STDMETHOD(GetSourceDisplayName) (THIS_ char * * lplpszDisplayName) PURE;
  981.     STDMETHOD(BindToSource) (THIS_ unsigned long bindflags, LPBINDCTX pbc) PURE;
  982.     STDMETHOD(BindIfRunning) (THIS) PURE;
  983.     STDMETHOD(GetBoundSource) (THIS_ LPLPUNKNOWN ppUnk) PURE;
  984.     STDMETHOD(UnbindSource) (THIS) PURE;
  985.     STDMETHOD(Update) (THIS_ LPBINDCTX pbc) PURE;
  986. };
  987. typedef         IOleLink * LPOLELINK, ** LPLPOLELINK;
  988.  
  989.  
  990. /****** OLE InPlace Editing Interfaces ************************************/
  991.  
  992.  
  993. typedef struct FARSTRUCT tagOIFI          // OleInPlaceFrameInfo
  994. {
  995.     long                recordLength;    // (2) == sizeof(OLEINPLACEFRAMEINFO)
  996.     long                version;        // (2) vers == 1
  997.     WindowPtr              frameWindow;    // (4) 
  998.     OSType                signature;        // (4) creator signature
  999.     long                refcon;            // (4) anything you want
  1000.     ProcessSerialNumber    psn;            // (8) psn
  1001.     Handle                 hCmdKeys;        // (4) must be null
  1002.     short                numCmds;        // (2) must be zero
  1003.     short                growHandles;    // (2) which grow handles allowed in server
  1004.     short                dragConstraint;    // (2) which direction dragging allowed in server
  1005.     Boolean               fAdjustMenus;    // (1) cont needs ::AdjustMenus called?
  1006.     Boolean               unused;            // (1) unused
  1007. } OLEINPLACEFRAMEINFO, * LPOLEINPLACEFRAMEINFO;
  1008.  
  1009.  
  1010. typedef struct tagOleMBarRec 
  1011. {
  1012.     long reserved;
  1013. } OleMBarRec, *OleMBarPtr, **OleMBarHandle;
  1014.  
  1015. #define noAxis    3        // indicates no grow or size in any direction
  1016. // see mac #defines noConstraint, hAxisOnly, vAxisOnly
  1017.  
  1018. typedef Rect    BORDERWIDTHS;
  1019. typedef Rect *  LPBORDERWIDTHS;
  1020. typedef LPCRECT LPCBORDERWIDTHS;
  1021.  
  1022. /* Inplace editing specific error codes */
  1023.  
  1024. #define    INPLACE_E_NOTUNDOABLE    (INPLACE_E_FIRST)
  1025. // undo is not avaiable
  1026.  
  1027. #define INPLACE_E_NOTOOLSPACE        (INPLACE_E_FIRST+1)
  1028. // Space for tools is not available
  1029.  
  1030. #define INPLACE_S_TRUNCATED        (INPLACE_S_FIRST)
  1031. // Message is too long, some of it had to be truncated before displaying
  1032.  
  1033. //misc definitions
  1034. #define INPLACE_DEFBORDERWIDTH    4
  1035.  
  1036. //      forward type declarations
  1037. #if defined(__cplusplus)
  1038. interface IOleInPlaceUIWindow;
  1039. #else 
  1040. //typedef interface IOleInPlaceUIWindow IOleInPlaceUIWindow;
  1041. #endif
  1042.  
  1043. typedef   interface  IOleInPlaceUIWindow * LPOLEINPLACEUIWINDOW, ** LPLPOLEINPLACEUIWINDOW;
  1044.  
  1045.  
  1046. #undef  INTERFACE
  1047. #define INTERFACE   IOleWindow
  1048.  
  1049. DECLARE_INTERFACE_(IOleWindow, IUnknown)
  1050.     BEGIN_INTERFACE
  1051.     // *** IUnknown methods ***
  1052.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  1053.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  1054.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  1055.  
  1056.     // *** IOleWindow methods ***
  1057.     STDMETHOD(GetWindow) (THIS_ WindowPtr * ppWnd) PURE;
  1058.     STDMETHOD(ContextSensitiveHelp) (THIS_ unsigned long fEnterMode) PURE;
  1059. };
  1060.  
  1061. typedef         IOleWindow * LPOLEWINDOW, ** LPLPOLEWINDOW;
  1062.  
  1063.  
  1064.  
  1065. #undef  INTERFACE
  1066. #define INTERFACE   IOleInPlaceObject
  1067.  
  1068. DECLARE_INTERFACE_(IOleInPlaceObject, IOleWindow)
  1069.     BEGIN_INTERFACE
  1070.     // *** IUnknown methods ***
  1071.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  1072.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  1073.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  1074.  
  1075.     // *** IOleWindow methods ***
  1076.     STDMETHOD(GetWindow) (THIS_ WindowPtr * ppWnd) PURE;
  1077.     STDMETHOD(ContextSensitiveHelp) (THIS_ unsigned long fEnterMode) PURE;
  1078.  
  1079.     // *** IOleInPlaceObject methods ***
  1080.     STDMETHOD(InPlaceDeactivate) (THIS) PURE;   
  1081.     STDMETHOD(UIDeactivate) (THIS) PURE;
  1082.     STDMETHOD(SetObjectRects) (THIS_ LPCRECT lprcPosRect, 
  1083.                     RgnHandle clipRgn,        // cliping area within containing window
  1084.                     RgnHandle frameRgn,        // entire structure rgn of containing window
  1085.                     RgnHandle cliRgn        // union of all structure rgns of all container app windows    
  1086.                     ) PURE;
  1087.     STDMETHOD(ReactivateAndUndo) (THIS) PURE;   
  1088. };
  1089. typedef         IOleInPlaceObject * LPOLEINPLACEOBJECT, ** LPLPOLEINPLACEOBJECT;
  1090.  
  1091.  
  1092.  
  1093. #undef  INTERFACE
  1094. #define INTERFACE   IOleInPlaceActiveObject
  1095.  
  1096. DECLARE_INTERFACE_(IOleInPlaceActiveObject, IOleWindow)
  1097.     BEGIN_INTERFACE
  1098.    // *** IUnknown methods ***
  1099.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  1100.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  1101.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  1102.  
  1103.     // *** IOleWindow methods ***
  1104.     STDMETHOD(GetWindow) (THIS_ WindowPtr * ppWnd) PURE;
  1105.     STDMETHOD(ContextSensitiveHelp) (THIS_ unsigned long fEnterMode) PURE;
  1106.  
  1107.     // *** IOleInPlaceActiveObject methods ***
  1108.     STDMETHOD(TranslateAccelerator) (THIS_ EventRecord * pEvt) PURE;   
  1109.     STDMETHOD(OnFrameWindowActivate) (THIS_ unsigned long fActivate) PURE;           
  1110.     STDMETHOD(OnDocWindowActivate) (THIS_ unsigned long fActivate) PURE;
  1111.     STDMETHOD(ResizeBorder) (THIS_ LPCRECT lprectBorder, LPOLEINPLACEUIWINDOW lpUIWindow, unsigned long fFrameWindow) PURE;          
  1112.     STDMETHOD(EnableModeless) (THIS_ unsigned long fEnable) PURE;
  1113. };
  1114. typedef         IOleInPlaceActiveObject * LPOLEINPLACEACTIVEOBJECT, ** LPLPOLEINPLACEACTIVEOBJECT;
  1115.  
  1116.  
  1117.  
  1118. #undef  INTERFACE
  1119. #define INTERFACE   IOleInPlaceUIWindow
  1120.  
  1121. DECLARE_INTERFACE_(IOleInPlaceUIWindow, IOleWindow)
  1122.     BEGIN_INTERFACE
  1123.    // *** IUnknown methods ***
  1124.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  1125.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  1126.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  1127.  
  1128.     // *** IOleWindow methods ***
  1129.     STDMETHOD(GetWindow) (THIS_ WindowPtr * ppWnd) PURE;
  1130.     STDMETHOD(ContextSensitiveHelp) (THIS_ unsigned long fEnterMode) PURE;
  1131.  
  1132.     // *** IOleInPlaceUIWindow methods ***
  1133.     STDMETHOD(GetBorder) (THIS_ Rect * lprectBorder) PURE;
  1134.     STDMETHOD(RequestBorderSpace) (THIS_ LPCBORDERWIDTHS lpborderwidths) PURE;
  1135.     STDMETHOD(SetBorderSpace) (THIS_ LPCBORDERWIDTHS lpborderwidths) PURE;
  1136.     STDMETHOD(SetActiveObject) (THIS_ LPOLEINPLACEACTIVEOBJECT lpActiveObject,
  1137.                         const char * lpszObjName) PURE; 
  1138. };
  1139. //typedef     IOleInPlaceUIWindow * LPOLEINPLACEUIWINDOW, ** LPLPOLEINPLACEUIWINDOW;
  1140.  
  1141.  
  1142.  
  1143. #undef  INTERFACE
  1144. #define INTERFACE   IOleInPlaceFrame
  1145.  
  1146.  
  1147. DECLARE_INTERFACE_(IOleInPlaceFrame, IOleInPlaceUIWindow)
  1148.     BEGIN_INTERFACE
  1149.    // *** IUnknown methods ***
  1150.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  1151.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  1152.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  1153.  
  1154.     // *** IOleWindow methods ***
  1155.     STDMETHOD(GetWindow) (THIS_ WindowPtr * ppWnd) PURE;
  1156.     STDMETHOD(ContextSensitiveHelp) (THIS_ unsigned long fEnterMode) PURE;
  1157.  
  1158.     // *** IOleInPlaceUIWindow methods ***
  1159.     STDMETHOD(GetBorder) (THIS_ Rect * lprectBorder) PURE;
  1160.     STDMETHOD(RequestBorderSpace) (THIS_ LPCBORDERWIDTHS lpborderwidths) PURE;
  1161.     STDMETHOD(SetBorderSpace) (THIS_ LPCBORDERWIDTHS lpborderwidths) PURE;
  1162.     STDMETHOD(SetActiveObject) (THIS_ LPOLEINPLACEACTIVEOBJECT lpActiveObject,
  1163.                     const char * lpszObjName) PURE; 
  1164.     
  1165.     
  1166.     // *** IOleInPlaceFrame methods ***
  1167.     STDMETHOD(InsertMenus) (THIS_ OleMBarHandle hOleMBar) PURE;
  1168.     STDMETHOD(AdjustMenus) (THIS_ OleMBarHandle hOleMBar) PURE;
  1169.     STDMETHOD(RemoveMenus) (THIS_ OleMBarHandle hOleMBar) PURE;
  1170.     STDMETHOD(SetStatusText) (THIS_ const char * lpszStatusText) PURE;    
  1171.     STDMETHOD(EnableModeless) (THIS_ unsigned long fEnable) PURE;
  1172.     STDMETHOD(TranslateAccelerator) (THIS_ EventRecord * pEvt, long ID) PURE;
  1173. };
  1174. typedef     IOleInPlaceFrame * LPOLEINPLACEFRAME, ** LPLPOLEINPLACEFRAME;
  1175.  
  1176.  
  1177. #undef  INTERFACE
  1178. #define INTERFACE   IOleInPlaceSite
  1179.  
  1180.  
  1181. DECLARE_INTERFACE_(IOleInPlaceSite, IOleWindow)
  1182.     BEGIN_INTERFACE
  1183.    // *** IUnknown methods ***
  1184.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  1185.     STDMETHOD_(unsigned long,AddRef) (THIS)  PURE;
  1186.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  1187.  
  1188.     // *** IOleWindow methods ***
  1189.     STDMETHOD(GetWindow) (THIS_ WindowPtr * ppWnd) PURE;
  1190.     STDMETHOD(ContextSensitiveHelp) (THIS_ unsigned long fEnterMode) PURE;
  1191.  
  1192.     // *** IOleInPlaceSite methods ***
  1193.     STDMETHOD(CanInPlaceActivate) (THIS) PURE;
  1194.     STDMETHOD(OnInPlaceActivate) (THIS) PURE;
  1195.     STDMETHOD(OnUIActivate) (THIS) PURE;    
  1196.     STDMETHOD(OnUIVisible) (THIS_ unsigned long fVisible) PURE;    // true if visibile
  1197.  
  1198.     STDMETHOD(GetObjectRects) (THIS_ 
  1199.                     Rect * lprcPosRect,
  1200.                 // server allocs, container fills, server frees
  1201.                     RgnHandle clipRgn,        // defines vis rgn
  1202.                     RgnHandle frameRgn,        // containing window strucRgn
  1203.                     RgnHandle cliRgn        // all container app strucRgns
  1204.                       ) PURE;
  1205.     STDMETHOD(GetWindowContext) (THIS_ 
  1206.                         LPLPOLEINPLACEFRAME lplpFrame,
  1207.                         LPLPOLEINPLACEUIWINDOW lplpDoc,
  1208.                         //WindowPtr    *ppWindow,
  1209.                         Rect *lprcPosRect,
  1210.                     // server allocs, container fills, server frees
  1211.                         RgnHandle clipRgn,        // defines vis rgn
  1212.                         RgnHandle frameRgn,        // containing window strucRgn
  1213.                         RgnHandle cliRgn,        // all container app strucRgns
  1214.                         LPOLEINPLACEFRAMEINFO lpFrameInfo) PURE;
  1215.     STDMETHOD(Scroll) (THIS_ long scrollExtent) PURE;       
  1216.     STDMETHOD(OnUIDeactivate) (THIS_ unsigned long fUndoable) PURE;      
  1217.     STDMETHOD(OnInPlaceDeactivate) (THIS) PURE;
  1218.     STDMETHOD(DiscardUndoState) (THIS) PURE;
  1219.     STDMETHOD(DeactivateAndUndo) (THIS) PURE;
  1220.     STDMETHOD(OnPosRectChange) (THIS_ LPCRECT lprcPosRect) PURE; 
  1221. };
  1222. typedef         IOleInPlaceSite * LPOLEINPLACESITE, ** LPLPOLEINPLACESITE;
  1223.  
  1224.  
  1225.  
  1226. /****** OLE API Prototypes ************************************************/
  1227.  
  1228. STDAPI_(unsigned long) OleBuildVersion( void );
  1229.  
  1230. /* helper functions */
  1231. STDAPI ReadClassStg(LPSTORAGE pStg, CLSID * pclsid);
  1232. STDAPI WriteClassStg(LPSTORAGE pStg, REFCLSID rclsid);
  1233. STDAPI ReadClassStm(LPSTREAM pStm, CLSID * pclsid);
  1234. STDAPI WriteClassStm(LPSTREAM pStm, REFCLSID rclsid);
  1235. STDAPI WriteFmtUserTypeStg (LPSTORAGE pstg, unsigned long cf, char * lpszUserType);
  1236. STDAPI ReadFmtUserTypeStg (LPSTORAGE pstg, unsigned long * pcf, char * * lplpszUserType);
  1237.  
  1238.  
  1239. /* init/term */
  1240.  
  1241.  
  1242. typedef enum tagOLEMANAGER
  1243. {
  1244.     OLEMGR_BIND_NORMAL = 0,          // normal app, launch, bind, and addref
  1245.     OLEMGR_BIND_IF_THERE = 1,    // app only wishes to bind if applet already running
  1246.                                 // useful only for mini-servers
  1247.     OLEMGR_NO_ADDREF = 2,         // do not refct the applet, will bind only if applet running
  1248.                                 // useful only for addins
  1249.     OLEMGR_ASYNC = 4,            // not yet supported
  1250.     OLEMGR_FORCELONG    =    2147483647
  1251. } OLEMANAGER;
  1252.  
  1253.  
  1254. STDAPI_(unsigned long) IsOleManagerRunning(void);        // returns ref ct    
  1255. STDAPI InitOleManager(long dwFlags);                    // dwReserved must be NULL
  1256. STDAPI_(unsigned long) UninitOleManager(void);            // returns true/false
  1257.  
  1258.  
  1259.  
  1260. STDAPI OleInitialize(LPMALLOC pMalloc);
  1261. STDAPI_(void) OleUninitialize(void);
  1262.  
  1263.  
  1264. /* APIs to query whether (Embedded/Linked) object can be created from 
  1265.    the data object */
  1266.  
  1267. STDAPI  OleQueryLinkFromData(LPDATAOBJECT pSrcDataObject);
  1268. STDAPI  OleQueryCreateFromData(LPDATAOBJECT pSrcDataObject);
  1269.                     
  1270.  
  1271. /* Object creation APIs */
  1272.  
  1273. STDAPI  OleCreate(REFCLSID rclsid, REFIID riid, unsigned long renderopt, 
  1274.                 LPFORMATETC pFormatEtc, LPOLECLIENTSITE pClientSite, 
  1275.                 LPSTORAGE pStg, void * * ppvObj); 
  1276.  
  1277. STDAPI  OleCreateFromData(LPDATAOBJECT pSrcDataObj, REFIID riid, 
  1278.                 unsigned long renderopt, LPFORMATETC pFormatEtc, 
  1279.                 LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, 
  1280.                 void * * ppvObj);
  1281.  
  1282. STDAPI  OleCreateLinkFromData(LPDATAOBJECT pSrcDataObj, REFIID riid, 
  1283.                 unsigned long renderopt, LPFORMATETC pFormatEtc, 
  1284.                 LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, 
  1285.                 void * * ppvObj);
  1286.  
  1287. STDAPI  OleCreateStaticFromData(LPDATAOBJECT pSrcDataObj, REFIID iid, 
  1288.                 unsigned long renderopt, LPFORMATETC pFormatEtc, 
  1289.                 LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, 
  1290.                 void * * ppvObj);    
  1291.  
  1292.                 
  1293. STDAPI  OleCreateLink(LPMONIKER pmkLinkSrc, REFIID riid, 
  1294.             unsigned long renderopt, LPFORMATETC lpFormatEtc, 
  1295.             LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, void * * ppvObj);
  1296.  
  1297. // MAC Also has the API's OleCreateLinkToFSp and OleCreateFromFSp defined.
  1298.  
  1299. STDAPI  OleCreateLinkToFile(const char * lpszFileName, REFIID riid, 
  1300.             unsigned long renderopt, LPFORMATETC lpFormatEtc, 
  1301.             LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, void * * ppvObj);
  1302.             
  1303. STDAPI  OleCreateFromFile(REFCLSID rclsid, const char * lpszFileName, REFIID riid, 
  1304.             unsigned long renderopt, LPFORMATETC lpFormatEtc, 
  1305.             LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, void * * ppvObj);
  1306.                                 
  1307.  
  1308. STDAPI  OleLoad(LPSTORAGE pStg, REFIID riid, LPOLECLIENTSITE pClientSite, 
  1309.             void * * ppvObj);
  1310.             
  1311. STDAPI  OleSave(LPPERSISTSTORAGE pPS, LPSTORAGE pStg, unsigned long fSameAsLoad);
  1312.  
  1313. STDAPI  OleLoadFromStream( LPSTREAM pStm, REFIID iidInterface, void * * ppvObj);
  1314. STDAPI  OleSaveToStream( LPPERSISTSTREAM pPStm, LPSTREAM pStm );
  1315.  
  1316.  
  1317. STDAPI  OleSetContainedObject(LPUNKNOWN pUnknown, unsigned long fContained);
  1318. STDAPI  OleNoteObjectVisible(LPUNKNOWN pUnknown, unsigned long fVisible);
  1319.  
  1320.  
  1321. /* Drag/Drop APIs */
  1322.  
  1323. STDAPI  RegisterDragDrop(WindowPtr pWnd, LPDROPTARGET pDropTarget);
  1324. STDAPI  RevokeDragDrop(WindowPtr pWnd);
  1325. STDAPI  DoDragDrop(LPDATAOBJECT pDataObj, LPDROPSOURCE pDropSource,
  1326.             unsigned long dwOKEffects, unsigned long    * pdwEffect);
  1327.  
  1328. /* Clipboard APIs */
  1329.  
  1330. STDAPI  OleSetClipboard(LPDATAOBJECT pDataObj);
  1331. STDAPI  OleGetClipboard(LPLPDATAOBJECT ppDataObj);
  1332. STDAPI  OleFlushClipboard(void);
  1333. STDAPI  OleIsCurrentClipboard(LPDATAOBJECT pDataObj);
  1334.  
  1335.  
  1336. /* InPlace Editing APIs */                                
  1337.  
  1338.  
  1339. STDAPI OleSendLLE(OSType sig, EventRecord *pevt);
  1340. STDAPI OleSendLowLevelEvent(ProcessSerialNumber *ppsn, EventRecord *pevt);
  1341.  
  1342. STDAPI    OleNewMBar(OleMBarHandle *phOleMBar);
  1343.  
  1344. STDAPI    OleDisposeMBar(OleMBarHandle hOleMBar);
  1345.  
  1346. STDAPI  OleInsertMenus(OleMBarHandle hOleMBar, short beforeID1, short beforeID3, short beforeID5); 
  1347.     // OleInsertMenus inserts the hOleMbar menus into the menu list.
  1348.     // each group of menus is inserted before the menu whose
  1349.     // menu ID equals beforeID#. If beforeID# is Ø (or isn't the ID of any menu
  1350.     // in the menu list), the new menu is added after all others. If the menu
  1351.     // is already in the menu list or the menu list is already full, InsertMenu
  1352.     // does nothing. Be sure to call DrawMenuBar to update the menu bar.
  1353.  
  1354. STDAPI  OleHashMenuID(short *pMenuID);
  1355.     // container calls this passing menuid.  If this menuid is currently
  1356.     // hashed, then the hash value is returned.
  1357.  
  1358. STDAPI  OleUnhashMenuID(short *pMenuID);
  1359.     // the container calls this api passing a menuid returned by menu select
  1360.     // this id is unhashed and returned.  If menuid is not hashed,
  1361.     // then in menuID == out menuID
  1362.  
  1363. STDAPI  OlePatchGetMHandle(OleMBarHandle hOleMBar);
  1364.     // Container app calls this to patch GetMHandle.
  1365.     // the menu id's in hOleMbar will be hashed to a range in 15000-17000.
  1366.     // This call should be balanced by call to OleUnpatchGetMHandle.
  1367.  
  1368. STDAPI  OleUnpatchGetMHandle(OleMBarHandle hOleMBar);
  1369.     // Container app calls this to unhash menus and remove GetMHandle patch.
  1370.     // Menus are unhashed and patch is removed if and only if there are
  1371.     // no more unbalanced calls to OlePatchGetMHandle
  1372.  
  1373. STDAPI  OleAddMBarMenu(OleMBarHandle hOleMBar, MenuHandle hMenu, short group);
  1374.     // OleAddMBarMenu adds hMenu to the Ole MBar.  This is called only
  1375.     // by the client and group is 0,2,4,-1.  -1 is for Hierarchical menus.
  1376.  
  1377. STDAPI OleSetInFrontOf(ProcessSerialNumber *pPsn);
  1378.  
  1379. STDAPI    OleSetInPlaceWindow(WindowPtr pWndObject, LPOLEINPLACEFRAMEINFO lpFrameInfo);
  1380.     // OleSetInPlaceWindow is called by the server to tell the 
  1381.     // dlls which window is serving the inplace object.  The dlls
  1382.     // will subclass this window's wdef to remove all structure
  1383.     // rgn from the window.  This is the official request to begin
  1384.     // inplace UI.  Server may change any fields of the frameinfo
  1385.     // before calling this api (eg, growhandles)
  1386.  
  1387. STDAPI    OleUnSetInPlaceWindow(unsigned long fInvalidate);
  1388.     // OleUnSetInPlaceWindow is called by the server to indicate
  1389.     // that the inplace window should be un-subclassed and all
  1390.     // the clipped windows should be unclipped.
  1391.     // if fInvalidate is true, implies server must invalidate rgns
  1392.     // NOTE: only pass TRUE if container is NOT pulling itself forward
  1393.     // or you will get flicker! 
  1394.  
  1395. STDAPI  OleClipWindows(WindowPtr pWndClip);
  1396.     // OleClipWindows is called by the server app to clip all windows
  1397.     // in its windowlist behind and including pWndClip.
  1398.     // This makes the server app appear to remain in the background.
  1399.     // NOTE, you must call OleSetInPlaceWindow() first.
  1400.  
  1401. STDAPI  OleClipWindow(WindowPtr pWndClip);
  1402. STDAPI  OleUnclipWindow(WindowPtr pWndClip, Boolean fPaint);
  1403.  
  1404.  
  1405. STDAPI_(void) OleMoveWindow(WindowPtr pWnd, 
  1406.                             short hPosition, short vPosition, 
  1407.                             Boolean fActivate);
  1408.     // called by container or server on window and this does the right thing
  1409.  
  1410. STDAPI_(void) OleDragParentWindow(WindowPtr pWnd,
  1411.                     Point startPt, const Rect *pLimitRect);
  1412.     // Same as mac trap, but removes server windows from
  1413.     // clipping region
  1414.  
  1415. STDAPI_(long) OleDragObjectWindow(WindowPtr pWnd,
  1416.                     Point startPt, const Rect *pLimitRect, const Rect *pSlopRect,
  1417.                     short constrain, ProcPtr actionProc);
  1418.     // bounds is intersected w/ the parent window rect as drag limit
  1419.     // constrain limits direction of drag
  1420.     // draggrayrgn
  1421.  
  1422.  
  1423. STDAPI_(void) OleSizeParentWindow(WindowPtr pWnd, short h, short v, Boolean fUpdate);
  1424.     // Same as mac trap, but clips ip server window
  1425.  
  1426.  
  1427. STDAPI_(void) OleSizeObjectWindow(WindowPtr pWnd, const Rect *prcNewBounds, Boolean fUpdate);
  1428.     // does a movewindow/sizewindow to effectively "zoom" window to new location/size
  1429.  
  1430. STDAPI_(long) OleZoomParentWindow(WindowPtr pWnd, short wPart, Boolean fMakeFront);
  1431.     // same as mac trap
  1432.  
  1433. STDAPI_(long) OleGrowParentWindow(WindowPtr pWnd, Point pt, const Rect *prcMinMax);
  1434.     // same as mac trap
  1435.  
  1436.  
  1437. STDAPI_(long) OleGrowObjectWindow(WindowPtr pWnd, Point pt, const Rect *prcMinMax, Rect *prcNewBounds);
  1438.     // OleGrowObjectWindow is called by the server app to track the resize handles
  1439.     // of the inplace window.  pass the inplace windowptr, global point
  1440.     // that the mouse went down, constraining min/max lengths in a rect
  1441.     // like growwindow top left is min height/width bottom right is
  1442.     // max height/width, the output rect prcNewBounds is 
  1443.     // dims or rect to pass to olesizewindow and SetInplaceRects
  1444.  
  1445. STDAPI_(short) OleWhichGrowHandle(WindowPtr pWnd, Point pt);
  1446.     // pt is in global coordinates
  1447.     // returns -2, this window is not inplace active
  1448.     // returns -1, not in grow rgn
  1449.     // 0 == standard grow box
  1450.     // 1..8 handles numbered from top left to bot right
  1451.     // this api calls FindWindow to ensure window part is
  1452.     // visible
  1453.  
  1454. STDAPI    OleGetCursor(CursPtr pCursor, WindowPtr pWndObject);
  1455.     // server calls this to get cursor info from container.
  1456.     // objectWindow is server's current ip window
  1457.     // pCursor is ptr to 68 bytes to receive the cursor data
  1458.  
  1459. STDAPI    OleSetCursor(CursPtr pCursor, WindowPtr pWndParent);
  1460.     // container optionally calls this to set up cursor info.
  1461.     // if container does not set up custom cursors, standard
  1462.     // arrow will be assumed.
  1463.     // if pWndParent is not the current ip parent window
  1464.     // this api return error
  1465.  
  1466. STDAPI    OleUpdateCursor(WindowPtr pWndObject);
  1467.     // Server calls this to change cursor for container while
  1468.     // in foreground.  This is a short cut for calling 
  1469.     // OleGetCursor(), OleWhichGrowHandle(), SetCursor().
  1470.     // If no cursor information was supplied by container
  1471.     // the standard arrow cursor will be used
  1472.     // if the cursor is over the drag/resize area of the object window
  1473.     // standard resize cursors will be drawn.
  1474.  
  1475.  
  1476. STDAPI  OleSetInPlaceRects(
  1477.         RgnHandle posRgn, 
  1478.         RgnHandle clipRgn, RgnHandle frameRgn, 
  1479.         RgnHandle cliRgn, RgnHandle clickRgn);
  1480.     // OleSetInPlaceRects is called by the server app to inform the
  1481.     // inplace window how to clip itself to client app windows
  1482.     // the 1st 3 params are the same as SetObjectRects,
  1483.     // all rect/rgn coords are GLOBAL
  1484.     // posRgn - obj pos Rgn
  1485.     // clipRgn - rgn in which object may display itself visibly
  1486.     // frameRgn - strucRgn of obj's containing window
  1487.     // cliRgn - the union of all open/visible client app windows strucRgns
  1488.     // clickRgn - if non-null is sub'ed from posRgn and passed to ole2init to 
  1489.     // catch mouse clicks    (obsolete now?) bugbug
  1490.  
  1491. STDAPI  OleSetParentRgns(RgnHandle clipRgn, 
  1492.     RgnHandle frameRgn, RgnHandle clientRgn);
  1493. //
  1494.  
  1495. STDAPI  OleSetObjectRgn(RgnHandle posRgn);
  1496. // this call is optional
  1497.  
  1498.  
  1499. STDAPI    OleMaskMouse(Boolean bEnable);
  1500.     // server calls this api to turn mouseDown->app1Evt coercion on or off
  1501.     // server calls OleMaskMouse(false) to put up modal dbox
  1502.     // and OleMaskMouse(true) when the dbox is done
  1503.  
  1504. STDAPI    OleTranslateAccelerator (LPOLEINPLACEFRAME lpFrame, 
  1505.             LPOLEINPLACEFRAMEINFO lpFrameInfo, EventRecord * pEvt);
  1506.     // calls menukey to get menuid, then calls lpFrame->TranslateAccelerator,
  1507.     // then calls HiliteMenu(0);
  1508.  
  1509.  
  1510.                                     
  1511. /* Helper APIs */
  1512. STDAPI_(Handle) OleDuplicateData (Handle hSrc, unsigned long cfFormat, 
  1513.                         unsigned short uiFlags);
  1514.  
  1515. STDAPI          OleDraw (LPUNKNOWN pUnknown, unsigned long dwAspect, GrafPtr pGrafDraw, 
  1516.                     LPCRECT lprcBounds); 
  1517.                         
  1518. STDAPI          OleRun(LPUNKNOWN pUnknown);
  1519. STDAPI_(unsigned long)   OleIsRunning(LPOLEOBJECT pObject);
  1520.  
  1521. STDAPI          OleLockRunning(LPUNKNOWN pUnknown, unsigned long fLock, unsigned long fLastUnlockCloses);
  1522.  
  1523. STDAPI_(void)   ReleaseStgMedium(LPSTGMEDIUM);
  1524. STDAPI          CreateOleAdviseHolder(LPLPOLEADVISEHOLDER ppOAHolder);
  1525.  
  1526. STDAPI          OleCreateDefaultHandler(REFCLSID clsid, LPUNKNOWN pUnkOuter,
  1527.                     REFIID riid, void * * lplpObj);
  1528.  
  1529. STDAPI          OleCreateEmbeddingHelper(REFCLSID clsid, LPUNKNOWN pUnkOuter,
  1530.                     unsigned long flags, LPCLASSFACTORY pCF,
  1531.                     REFIID riid, void ** lplpObj);
  1532.  
  1533. #ifdef MERGE
  1534. STDAPI_(BOOL)    IsAccelerator(HACCEL hAccel, int cAccelEntries, LPMSG lpMsg, 
  1535.                     WORD FAR* lpwCmd);
  1536. #endif
  1537.  
  1538.                     
  1539. /* Icon extraction Helper APIs */
  1540.                     
  1541. STDAPI_(PicHandle) OleGetIconOfFile(char * lpszPath, unsigned long fUseFileAsLabel);
  1542. STDAPI_(PicHandle) OleGetIconOfClass(REFCLSID rclsid,    char * lpszLabel, 
  1543.                                     unsigned long fUseTypeAsLabel);
  1544.  
  1545.  
  1546. /* Registration Database Helper APIs */
  1547.  
  1548. STDAPI             OleRegGetUserType (REFCLSID clsid, unsigned long dwFormOfType,
  1549.                     char ** pszUserType);
  1550.  
  1551. STDAPI             OleRegGetMiscStatus    (REFCLSID clsid, unsigned long dwAspect,
  1552.                     unsigned long* pdwStatus);
  1553.  
  1554. STDAPI             OleRegEnumFormatEtc    (REFCLSID clsid, unsigned long dwDirection,
  1555.                     LPLPENUMFORMATETC ppenum);
  1556.  
  1557. STDAPI             OleRegEnumVerbs    (REFCLSID clsid, LPLPENUMOLEVERB ppenum);
  1558.  
  1559.  
  1560.  
  1561. /* OLE 1.0 conversion APIS */
  1562.  
  1563. STDAPI OleConvertIStorageToOLESTREAM
  1564.     (LPSTORAGE            pstg,
  1565.      LPOLESTREAM        polestm);
  1566.  
  1567. STDAPI OleConvertOLESTREAMToIStorage
  1568.     (LPOLESTREAM                polestm,
  1569.     LPSTORAGE                   pstg,
  1570.     const DVTARGETDEVICE *   ptd);
  1571.  
  1572. STDAPI OleConvertIStorageToOLESTREAMEx
  1573.     (LPSTORAGE            pstg,
  1574.                                     // Presentation data to OLESTREAM
  1575.      unsigned long            cfFormat,    //        format
  1576.      long                lWidth,        //        width
  1577.      long                lHeight,    //        height
  1578.      unsigned long        dwSize,        //        size in bytes
  1579.      LPSTGMEDIUM        pmedium,    //        bits
  1580.      LPOLESTREAM        polestm);
  1581.  
  1582. STDAPI OleConvertOLESTREAMToIStorageEx
  1583.     (LPOLESTREAM        polestm,
  1584.      LPSTORAGE            pstg,
  1585.                                     // Presentation data from OLESTREAM
  1586.      unsigned long *    pcfFormat,    //        format
  1587.      long *            plwWidth,    //        width
  1588.      long *            plHeight,    //        height
  1589.      unsigned long *            pdwSize,    //        size in bytes
  1590.      LPSTGMEDIUM        pmedium);    //        bits
  1591.  
  1592.  
  1593.  
  1594. /* Storage Utility APIs */
  1595. STDAPI GetHGlobalFromILockBytes (LPLOCKBYTES plkbyt, Handle * phglobal);
  1596. STDAPI CreateILockBytesOnHGlobal (Handle hGlobal, unsigned long fDeleteOnRelease,
  1597.                                     LPLPLOCKBYTES pplkbyt);
  1598.  
  1599. STDAPI GetHGlobalFromStream (LPSTREAM pstm, Handle * phglobal);
  1600. STDAPI CreateStreamOnHGlobal (Handle hGlobal, unsigned long fDeleteOnRelease,
  1601.                                 LPLPSTREAM ppstm);
  1602.  
  1603.  
  1604. /* ConvertTo APIS */
  1605.  
  1606. STDAPI OleDoAutoConvert(LPSTORAGE pStg, LPCLSID pClsidNew);
  1607. STDAPI OleGetAutoConvert(REFCLSID clsidOld, LPCLSID pClsidNew);
  1608. STDAPI OleSetAutoConvert(REFCLSID clsidOld, REFCLSID clsidNew);
  1609. STDAPI GetConvertStg(LPSTORAGE pStg);
  1610. STDAPI SetConvertStg(LPSTORAGE pStg, unsigned long fConvert);
  1611.  
  1612. #ifndef __MACAPI__
  1613. #include <macapi.h>
  1614. #endif
  1615.  
  1616. #ifdef WLM
  1617. #include "macname2.h"
  1618. #endif // WLM
  1619.  
  1620. #endif /* !__OLE2__ */
  1621.  
  1622.