Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1208 lines
40 KiB

  1. /*****************************************************************************\
  2. * *
  3. * ole2.h - main ole2 header; includes all subcomponents *
  4. * *
  5. * Version 1.0 *
  6. * *
  7. * Copyright (c) 1993-1994, Microsoft Corp. All rights reserved. *
  8. * *
  9. \*****************************************************************************/
  10. #if !defined( _OLE2_H_ )
  11. #define _OLE2_H_
  12. #ifndef RC_INVOKED
  13. #pragma warning(disable:4001)
  14. #endif /* RC_INVOKED */
  15. #include <string.h>
  16. /****** Standard Object Definitions *****************************************/
  17. #include <compobj.h>
  18. // *************** FACILITY_ITF scodes common to all interfaces ************
  19. //
  20. // By convention, OLE interfaces divide the FACILITY_ITF range of errors
  21. // into nonoverlapping subranges. If an interface returns a FACILITY_ITF
  22. // scode, it must be from the range associated with that interface or from
  23. // the shared range: OLE_E_FIRST...OLE_E_LAST.
  24. //
  25. // error codes
  26. #define OLE_E_OLEVERB (OLE_E_FIRST)
  27. // invalid OLEVERB structure
  28. #define OLE_E_ADVF (OLE_E_FIRST+1)
  29. // invalid advise flags
  30. #define OLE_E_ENUM_NOMORE (OLE_E_FIRST+2)
  31. // you can't enuemrate any more, because the associated data is missing
  32. #define OLE_E_ADVISENOTSUPPORTED (OLE_E_FIRST+3)
  33. // this implementation doesn't take advises
  34. #define OLE_E_NOCONNECTION (OLE_E_FIRST+4)
  35. // there is no connection for this connection id
  36. #define OLE_E_NOTRUNNING (OLE_E_FIRST+5)
  37. // need run the object to perform this operation
  38. #define OLE_E_NOCACHE (OLE_E_FIRST+6)
  39. // there is no cache to operate on
  40. #define OLE_E_BLANK (OLE_E_FIRST+7)
  41. // Uninitialized object
  42. #define OLE_E_CLASSDIFF (OLE_E_FIRST+8)
  43. // linked object's source class has changed
  44. #define OLE_E_CANT_GETMONIKER (OLE_E_FIRST+9)
  45. // not able to get the moniker of the object
  46. #define OLE_E_CANT_BINDTOSOURCE (OLE_E_FIRST+10)
  47. // not able to bind to the source
  48. #define OLE_E_STATIC (OLE_E_FIRST+11)
  49. // object is static, operation not allowed
  50. #define OLE_E_PROMPTSAVECANCELLED (OLE_E_FIRST+12)
  51. // user cancelled out of save dialog
  52. #define OLE_E_INVALIDRECT (OLE_E_FIRST+13)
  53. // invalid rectangle
  54. #define OLE_E_WRONGCOMPOBJ (OLE_E_FIRST+14)
  55. // compobj.dll is too old for the ole2.dll initialized
  56. #define OLE_E_INVALIDHWND (OLE_E_FIRST+15)
  57. // invalid window handle
  58. #define OLE_E_NOT_INPLACEACTIVE (OLE_E_FIRST+16)
  59. // object is not in any of the inplace active states
  60. #define DVGEN_E_FIRST (OLE_E_FIRST+100)
  61. #define DV_E_FORMATETC (DVGEN_E_FIRST)
  62. // invalid FORMATETC structure
  63. #define DV_E_DVTARGETDEVICE (DVGEN_E_FIRST+1)
  64. // invalid DVTARGETDEVICE structure
  65. #define DV_E_STGMEDIUM (DVGEN_E_FIRST+2)
  66. // invalid STDGMEDIUM structure
  67. #define DV_E_STATDATA (DVGEN_E_FIRST+3)
  68. // invalid STATDATA structure
  69. #define DV_E_LINDEX (DVGEN_E_FIRST+4)
  70. // invalid lindex
  71. #define DV_E_TYMED (DVGEN_E_FIRST+5)
  72. // invalid tymed
  73. #define DV_E_CLIPFORMAT (DVGEN_E_FIRST+6)
  74. // invalid clipboard format
  75. #define DV_E_DVASPECT (DVGEN_E_FIRST+7)
  76. // invalid aspect(s)
  77. #define DV_E_DVTARGETDEVICE_SIZE (DVGEN_E_FIRST+8)
  78. // tdSize paramter of the DVTARGETDEVICE structure is invalid
  79. #define DV_E_NOIVIEWOBJECT (DVGEN_E_FIRST+9)
  80. // object doesn't support IViewObject interface
  81. // Success codes
  82. #define OLE_S_USEREG (OLE_S_FIRST)
  83. // use the reg database to provide the requested info
  84. #define OLE_S_STATIC (OLE_S_FIRST+1)
  85. // success, but static
  86. #define OLE_S_MAC_CLIPFORMAT (OLE_S_FIRST+2)
  87. // macintosh clipboard format
  88. //*************************** Interface or API specific scodes *************
  89. // Errors for OleConvertOLESTREAMToIStorage and OleConvertIStorageToOLESTREAM
  90. // OLESTREAM Get method failed
  91. #define CONVERT10_E_OLESTREAM_GET (CONVERT10_E_FIRST + 0)
  92. // OLESTREAM Put method failed
  93. #define CONVERT10_E_OLESTREAM_PUT (CONVERT10_E_FIRST + 1)
  94. // Contents of the OLESTREAM not in correct format
  95. #define CONVERT10_E_OLESTREAM_FMT (CONVERT10_E_FIRST + 2)
  96. // There was in an error in a Windows GDI call while converting the bitmap
  97. // to a DIB.
  98. #define CONVERT10_E_OLESTREAM_BITMAP_TO_DIB (CONVERT10_E_FIRST + 3)
  99. // Contents of the IStorage not in correct format
  100. #define CONVERT10_E_STG_FMT (CONVERT10_E_FIRST + 4)
  101. // Contents of IStorage is missing one of the standard streams ("\1CompObj",
  102. // "\1Ole", "\2OlePres000"). This may be the storage for a DLL object, or a
  103. // class that does not use the def handler.
  104. #define CONVERT10_E_STG_NO_STD_STREAM (CONVERT10_E_FIRST + 5)
  105. // There was in an error in a Windows GDI call while converting the DIB
  106. // to a bitmap.
  107. #define CONVERT10_E_STG_DIB_TO_BITMAP (CONVERT10_E_FIRST + 6)
  108. // Returned by either API, this scode indicates that the original object
  109. // had no presentation, therefore the converted object does not either.
  110. #define CONVERT10_S_NO_PRESENTATION (CONVERT10_S_FIRST + 0)
  111. // Errors for Clipboard functions
  112. // OpenClipboard Failed
  113. #define CLIPBRD_E_CANT_OPEN (CLIPBRD_E_FIRST + 0)
  114. // EmptyClipboard Failed
  115. #define CLIPBRD_E_CANT_EMPTY (CLIPBRD_E_FIRST + 1)
  116. // SetClipboard Failed
  117. #define CLIPBRD_E_CANT_SET (CLIPBRD_E_FIRST + 2)
  118. // Data on clipboard is invalid
  119. #define CLIPBRD_E_BAD_DATA (CLIPBRD_E_FIRST + 3)
  120. // CloseClipboard Failed
  121. #define CLIPBRD_E_CANT_CLOSE (CLIPBRD_E_FIRST + 4)
  122. /****** OLE value types *****************************************************/
  123. /* rendering options */
  124. typedef enum tagOLERENDER
  125. {
  126. OLERENDER_NONE = 0,
  127. OLERENDER_DRAW = 1,
  128. OLERENDER_FORMAT = 2,
  129. OLERENDER_ASIS = 3
  130. } OLERENDER;
  131. typedef OLERENDER FAR* LPOLERENDER;
  132. // OLE verb; returned by IEnumOLEVERB
  133. typedef struct FARSTRUCT tagOLEVERB
  134. {
  135. LONG lVerb;
  136. LPSTR lpszVerbName;
  137. DWORD fuFlags;
  138. DWORD grfAttribs;
  139. } OLEVERB, FAR* LPOLEVERB;
  140. // Bitwise verb attributes used in OLEVERB.grfAttribs
  141. typedef enum tagOLEVERBATTRIB // bitwise
  142. {
  143. OLEVERBATTRIB_NEVERDIRTIES = 1,
  144. OLEVERBATTRIB_ONCONTAINERMENU = 2
  145. } OLEVERBATTRIB;
  146. // IOleObject::GetUserType optons; determines which form of the string to use
  147. typedef enum tagUSERCLASSTYPE
  148. {
  149. USERCLASSTYPE_FULL = 1,
  150. USERCLASSTYPE_SHORT= 2,
  151. USERCLASSTYPE_APPNAME= 3,
  152. } USERCLASSTYPE;
  153. // bits returned from IOleObject::GetMistStatus
  154. typedef enum tagOLEMISC // bitwise
  155. {
  156. OLEMISC_RECOMPOSEONRESIZE = 1,
  157. OLEMISC_ONLYICONIC = 2,
  158. OLEMISC_INSERTNOTREPLACE = 4,
  159. OLEMISC_STATIC = 8,
  160. OLEMISC_CANTLINKINSIDE = 16,
  161. OLEMISC_CANLINKBYOLE1 = 32,
  162. OLEMISC_ISLINKOBJECT = 64,
  163. OLEMISC_INSIDEOUT = 128,
  164. OLEMISC_ACTIVATEWHENVISIBLE = 256
  165. } OLEMISC;
  166. // IOleObject::Close options
  167. typedef enum tagOLECLOSE
  168. {
  169. OLECLOSE_SAVEIFDIRTY = 0,
  170. OLECLOSE_NOSAVE = 1,
  171. OLECLOSE_PROMPTSAVE = 2
  172. } OLECLOSE;
  173. // IOleObject::GetMoniker and IOleClientSite::GetMoniker options; determines
  174. // if and how monikers should be assigned.
  175. typedef enum tagOLEGETMONIKER
  176. {
  177. OLEGETMONIKER_ONLYIFTHERE=1,
  178. OLEGETMONIKER_FORCEASSIGN=2,
  179. OLEGETMONIKER_UNASSIGN=3,
  180. OLEGETMONIKER_TEMPFORUSER=4
  181. } OLEGETMONIKER;
  182. // IOleObject::GetMoniker, IOleObject::SetMoniker and
  183. // IOleClientSite::GetMoniker options; determines which moniker to use
  184. typedef enum tagOLEWHICHMK
  185. {
  186. OLEWHICHMK_CONTAINER=1,
  187. OLEWHICHMK_OBJREL=2,
  188. OLEWHICHMK_OBJFULL=3
  189. } OLEWHICHMK;
  190. #ifdef WIN32
  191. #define LPSIZEL PSIZEL
  192. #elif (WINVER < 0x0400)
  193. typedef struct FARSTRUCT tagSIZEL
  194. {
  195. long cx;
  196. long cy;
  197. } SIZEL, FAR* LPSIZEL;
  198. #endif
  199. #ifdef WIN32
  200. #define LPRECTL PRECTL
  201. #elif (WINVER < 0x0400)
  202. typedef struct FARSTRUCT tagRECTL
  203. {
  204. long left;
  205. long top;
  206. long right;
  207. long bottom;
  208. } RECTL, FAR* LPRECTL;
  209. typedef struct FARSTRUCT tagPOINTL {
  210. LONG x;
  211. LONG y;
  212. } POINTL;
  213. #endif
  214. #ifndef LPCRECT
  215. typedef const RECT FAR* LPCRECT;
  216. #endif
  217. #ifndef LPCRECTL
  218. typedef const RECTL FAR* LPCRECTL;
  219. #endif
  220. /***** OLE 1.0 OLESTREAM declarations *************************************/
  221. typedef struct _OLESTREAM FAR* LPOLESTREAM;
  222. typedef struct _OLESTREAMVTBL
  223. {
  224. DWORD (CALLBACK* Get)(LPOLESTREAM, void FAR*, DWORD);
  225. DWORD (CALLBACK* Put)(LPOLESTREAM, const void FAR*, DWORD);
  226. } OLESTREAMVTBL;
  227. typedef OLESTREAMVTBL FAR* LPOLESTREAMVTBL;
  228. typedef struct _OLESTREAM
  229. {
  230. LPOLESTREAMVTBL lpstbl;
  231. } OLESTREAM;
  232. /****** Clipboard Data structures *****************************************/
  233. typedef struct tagOBJECTDESCRIPTOR
  234. {
  235. ULONG cbSize; // Size of structure in bytes
  236. CLSID clsid; // CLSID of data being transferred
  237. DWORD dwDrawAspect; // Display aspect of the object
  238. // normally DVASPECT_CONTENT or ICON.
  239. // dwDrawAspect will be 0 (which is NOT
  240. // DVASPECT_CONTENT) if the copier or
  241. // dragsource didn't draw the object to
  242. // begin with.
  243. SIZEL sizel; // size of the object in HIMETRIC
  244. // sizel is opt.: will be (0,0) for apps
  245. // which don't draw the object being
  246. // transferred
  247. POINTL pointl; // Offset in HIMETRIC units from the
  248. // upper-left corner of the obj where the
  249. // mouse went down for the drag.
  250. // NOTE: y coordinates increase downward.
  251. // x coordinates increase to right
  252. // pointl is opt.; it is only meaningful
  253. // if object is transfered via drag/drop.
  254. // (0, 0) if mouse position is unspecified
  255. // (eg. when obj transfered via clipboard)
  256. DWORD dwStatus; // Misc. status flags for object. Flags are
  257. // defined by OLEMISC enum. these flags
  258. // are as would be returned
  259. // by IOleObject::GetMiscStatus.
  260. DWORD dwFullUserTypeName; // Offset from beginning of structure to
  261. // null-terminated string that specifies
  262. // Full User Type Name of the object.
  263. // 0 indicates string not present.
  264. DWORD dwSrcOfCopy; // Offset from beginning of structure to
  265. // null-terminated string that specifies
  266. // source of the transfer.
  267. // dwSrcOfCOpy is normally implemented as
  268. // the display name of the temp-for-user
  269. // moniker which identifies the source of
  270. // the data.
  271. // 0 indicates string not present.
  272. // NOTE: moniker assignment is NOT forced.
  273. // see IOleObject::GetMoniker(
  274. // OLEGETMONIKER_TEMPFORUSER)
  275. /* variable sized string data may appear here */
  276. } OBJECTDESCRIPTOR, *POBJECTDESCRIPTOR, FAR *LPOBJECTDESCRIPTOR,
  277. LINKSRCDESCRIPTOR, *PLINKSRCDESCRIPTOR, FAR *LPLINKSRCDESCRIPTOR;
  278. /* verbs */
  279. #define OLEIVERB_PRIMARY (0L)
  280. #define OLEIVERB_SHOW (-1L)
  281. #define OLEIVERB_OPEN (-2L)
  282. #define OLEIVERB_HIDE (-3L)
  283. #define OLEIVERB_UIACTIVATE (-4L)
  284. #define OLEIVERB_INPLACEACTIVATE (-5L)
  285. #define OLEIVERB_DISCARDUNDOSTATE (-6L)
  286. // forward type declarations
  287. #if defined(__cplusplus)
  288. interface IOleClientSite;
  289. interface IOleContainer;
  290. interface IOleObject;
  291. #else
  292. typedef interface IOleClientSite IOleClientSite;
  293. typedef interface IOleContainer IOleContainer;
  294. typedef interface IOleObject IOleObject;
  295. #endif
  296. typedef IOleObject FAR* LPOLEOBJECT;
  297. typedef IOleClientSite FAR* LPOLECLIENTSITE;
  298. typedef IOleContainer FAR* LPOLECONTAINER;
  299. /****** OLE GUIDs *********************************************************/
  300. #include "oleguid.h"
  301. /****** Other Major Interfaces ********************************************/
  302. #include <dvobj.h>
  303. #include <storage.h>
  304. /****** IDrop??? Interfaces ********************************************/
  305. #define MK_ALT 0x0020
  306. #define DROPEFFECT_NONE 0
  307. #define DROPEFFECT_COPY 1
  308. #define DROPEFFECT_MOVE 2
  309. #define DROPEFFECT_LINK 4
  310. #define DROPEFFECT_SCROLL 0x80000000
  311. // default inset-width of the hot zone, in pixels
  312. #define DD_DEFSCROLLINSET 11
  313. // default delay before scrolling, in milliseconds
  314. #define DD_DEFSCROLLDELAY 50
  315. /* Dragdrop specific error codes */
  316. #define DRAGDROP_E_NOTREGISTERED (DRAGDROP_E_FIRST)
  317. // trying to revoke a drop target that has not been registered
  318. #define DRAGDROP_E_ALREADYREGISTERED (DRAGDROP_E_FIRST+1)
  319. // this window has already been registered as a drop target
  320. #define DRAGDROP_E_INVALIDHWND (DRAGDROP_E_FIRST+2)
  321. // invalid HWND
  322. #define DRAGDROP_S_DROP (DRAGDROP_S_FIRST + 0)
  323. // successful drop took place
  324. #define DRAGDROP_S_CANCEL (DRAGDROP_S_FIRST + 1)
  325. // drag-drop operation canceled
  326. #define DRAGDROP_S_USEDEFAULTCURSORS (DRAGDROP_S_FIRST + 2)
  327. // use the default cursor
  328. #undef INTERFACE
  329. #define INTERFACE IDropTarget
  330. DECLARE_INTERFACE_(IDropTarget, IUnknown)
  331. {
  332. // *** IUnknown methods ***
  333. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  334. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  335. STDMETHOD_(ULONG,Release) (THIS) PURE;
  336. // *** IDropTarget methods ***
  337. STDMETHOD(DragEnter) (THIS_ LPDATAOBJECT pDataObj, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect) PURE;
  338. STDMETHOD(DragOver) (THIS_ DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect) PURE;
  339. STDMETHOD(DragLeave) (THIS) PURE;
  340. STDMETHOD(Drop) (THIS_ LPDATAOBJECT pDataObj, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect) PURE;
  341. };
  342. typedef IDropTarget FAR* LPDROPTARGET;
  343. #undef INTERFACE
  344. #define INTERFACE IDropSource
  345. DECLARE_INTERFACE_(IDropSource, IUnknown)
  346. {
  347. // *** IUnknown methods ***
  348. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  349. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  350. STDMETHOD_(ULONG,Release) (THIS) PURE;
  351. // *** IDropSource methods ***
  352. STDMETHOD(QueryContinueDrag) (THIS_ BOOL fEscapePressed, DWORD grfKeyState) PURE;
  353. STDMETHOD(GiveFeedback) (THIS_ DWORD dwEffect) PURE;
  354. };
  355. typedef IDropSource FAR* LPDROPSOURCE;
  356. /****** IPersist??? Interfaces ********************************************/
  357. #undef INTERFACE
  358. #define INTERFACE IPersist
  359. DECLARE_INTERFACE_(IPersist, IUnknown)
  360. {
  361. // *** IUnknown methods ***
  362. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  363. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  364. STDMETHOD_(ULONG,Release) (THIS) PURE;
  365. // *** IPersist methods ***
  366. STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  367. };
  368. typedef IPersist FAR* LPPERSIST;
  369. #undef INTERFACE
  370. #define INTERFACE IPersistStorage
  371. DECLARE_INTERFACE_(IPersistStorage, IPersist)
  372. {
  373. // *** IUnknown methods ***
  374. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  375. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  376. STDMETHOD_(ULONG,Release) (THIS) PURE;
  377. // *** IPersist methods ***
  378. STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  379. // *** IPersistStorage methods ***
  380. STDMETHOD(IsDirty) (THIS) PURE;
  381. STDMETHOD(InitNew) (THIS_ LPSTORAGE pStg) PURE;
  382. STDMETHOD(Load) (THIS_ LPSTORAGE pStg) PURE;
  383. STDMETHOD(Save) (THIS_ LPSTORAGE pStgSave, BOOL fSameAsLoad) PURE;
  384. STDMETHOD(SaveCompleted) (THIS_ LPSTORAGE pStgNew) PURE;
  385. STDMETHOD(HandsOffStorage) (THIS) PURE;
  386. };
  387. typedef IPersistStorage FAR* LPPERSISTSTORAGE;
  388. #undef INTERFACE
  389. #define INTERFACE IPersistStream
  390. DECLARE_INTERFACE_(IPersistStream, IPersist)
  391. {
  392. // *** IUnknown methods ***
  393. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  394. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  395. STDMETHOD_(ULONG,Release) (THIS) PURE;
  396. // *** IPersist methods ***
  397. STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  398. // *** IPersistStream methods ***
  399. STDMETHOD(IsDirty) (THIS) PURE;
  400. STDMETHOD(Load) (THIS_ LPSTREAM pStm) PURE;
  401. STDMETHOD(Save) (THIS_ LPSTREAM pStm,
  402. BOOL fClearDirty) PURE;
  403. STDMETHOD(GetSizeMax) (THIS_ ULARGE_INTEGER FAR * pcbSize) PURE;
  404. };
  405. typedef IPersistStream FAR* LPPERSISTSTREAM;
  406. #undef INTERFACE
  407. #define INTERFACE IPersistFile
  408. DECLARE_INTERFACE_(IPersistFile, IPersist)
  409. {
  410. // *** IUnknown methods ***
  411. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  412. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  413. STDMETHOD_(ULONG,Release) (THIS) PURE;
  414. // *** IPersist methods ***
  415. STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  416. // *** IPersistFile methods ***
  417. STDMETHOD(IsDirty) (THIS) PURE;
  418. STDMETHOD(Load) (THIS_ LPCSTR lpszFileName, DWORD grfMode) PURE;
  419. STDMETHOD(Save) (THIS_ LPCSTR lpszFileName, BOOL fRemember) PURE;
  420. STDMETHOD(SaveCompleted) (THIS_ LPCSTR lpszFileName) PURE;
  421. STDMETHOD(GetCurFile) (THIS_ LPSTR FAR * lplpszFileName) PURE;
  422. };
  423. typedef IPersistFile FAR* LPPERSISTFILE;
  424. /****** Moniker Object Interfaces ******************************************/
  425. #include <moniker.h>
  426. /****** OLE Object Interfaces ******************************************/
  427. #undef INTERFACE
  428. #define INTERFACE IEnumOLEVERB
  429. DECLARE_INTERFACE_(IEnumOLEVERB, IUnknown)
  430. {
  431. // *** IUnknown methods ***
  432. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  433. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  434. STDMETHOD_(ULONG,Release) (THIS) PURE;
  435. // *** IEnumOLEVERB methods ***
  436. STDMETHOD(Next) (THIS_ ULONG celt, LPOLEVERB rgelt, ULONG FAR* pceltFetched) PURE;
  437. STDMETHOD(Skip) (THIS_ ULONG celt) PURE;
  438. STDMETHOD(Reset) (THIS) PURE;
  439. STDMETHOD(Clone) (THIS_ IEnumOLEVERB FAR* FAR* ppenm) PURE;
  440. };
  441. typedef IEnumOLEVERB FAR* LPENUMOLEVERB;
  442. #undef INTERFACE
  443. #define INTERFACE IOleObject
  444. #define OLEOBJ_E_NOVERBS (OLEOBJ_E_FIRST + 0)
  445. #define OLEOBJ_E_INVALIDVERB (OLEOBJ_E_FIRST + 1)
  446. #define OLEOBJ_S_INVALIDVERB (OLEOBJ_S_FIRST + 0)
  447. #define OLEOBJ_S_CANNOT_DOVERB_NOW (OLEOBJ_S_FIRST + 1)
  448. // verb number is valid but verb cannot be done now, for instance
  449. // hiding a link or hiding a visible OLE 1.0 server
  450. #define OLEOBJ_S_INVALIDHWND (OLEOBJ_S_FIRST + 2)
  451. // invalid hwnd passed
  452. DECLARE_INTERFACE_(IOleObject, IUnknown)
  453. {
  454. // *** IUnknown methods ***
  455. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  456. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  457. STDMETHOD_(ULONG,Release) (THIS) PURE;
  458. // *** IOleObject methods ***
  459. STDMETHOD(SetClientSite) (THIS_ LPOLECLIENTSITE pClientSite) PURE;
  460. STDMETHOD(GetClientSite) (THIS_ LPOLECLIENTSITE FAR* ppClientSite) PURE;
  461. STDMETHOD(SetHostNames) (THIS_ LPCSTR szContainerApp, LPCSTR szContainerObj) PURE;
  462. STDMETHOD(Close) (THIS_ DWORD dwSaveOption) PURE;
  463. STDMETHOD(SetMoniker) (THIS_ DWORD dwWhichMoniker, LPMONIKER pmk) PURE;
  464. STDMETHOD(GetMoniker) (THIS_ DWORD dwAssign, DWORD dwWhichMoniker,
  465. LPMONIKER FAR* ppmk) PURE;
  466. STDMETHOD(InitFromData) (THIS_ LPDATAOBJECT pDataObject,
  467. BOOL fCreation,
  468. DWORD dwReserved) PURE;
  469. STDMETHOD(GetClipboardData) (THIS_ DWORD dwReserved,
  470. LPDATAOBJECT FAR* ppDataObject) PURE;
  471. STDMETHOD(DoVerb) (THIS_ LONG iVerb,
  472. LPMSG lpmsg,
  473. LPOLECLIENTSITE pActiveSite,
  474. LONG lindex,
  475. HWND hwndParent,
  476. LPCRECT lprcPosRect) PURE;
  477. STDMETHOD(EnumVerbs) (THIS_ LPENUMOLEVERB FAR* ppenumOleVerb) PURE;
  478. STDMETHOD(Update) (THIS) PURE;
  479. STDMETHOD(IsUpToDate) (THIS) PURE;
  480. STDMETHOD(GetUserClassID) (THIS_ CLSID FAR* pClsid) PURE;
  481. STDMETHOD(GetUserType) (THIS_ DWORD dwFormOfType, LPSTR FAR* pszUserType) PURE;
  482. STDMETHOD(SetExtent) (THIS_ DWORD dwDrawAspect, LPSIZEL lpsizel) PURE;
  483. STDMETHOD(GetExtent) (THIS_ DWORD dwDrawAspect, LPSIZEL lpsizel) PURE;
  484. STDMETHOD(Advise)(THIS_ LPADVISESINK pAdvSink, DWORD FAR* pdwConnection) PURE;
  485. STDMETHOD(Unadvise)(THIS_ DWORD dwConnection) PURE;
  486. STDMETHOD(EnumAdvise) (THIS_ LPENUMSTATDATA FAR* ppenumAdvise) PURE;
  487. STDMETHOD(GetMiscStatus) (THIS_ DWORD dwAspect, DWORD FAR* pdwStatus) PURE;
  488. STDMETHOD(SetColorScheme) (THIS_ LPLOGPALETTE lpLogpal) PURE;
  489. };
  490. typedef IOleObject FAR* LPOLEOBJECT;
  491. #undef INTERFACE
  492. #define INTERFACE IOleClientSite
  493. DECLARE_INTERFACE_(IOleClientSite, IUnknown)
  494. {
  495. // *** IUnknown methods ***
  496. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  497. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  498. STDMETHOD_(ULONG,Release) (THIS) PURE;
  499. // *** IOleClientSite methods ***
  500. STDMETHOD(SaveObject) (THIS) PURE;
  501. STDMETHOD(GetMoniker) (THIS_ DWORD dwAssign, DWORD dwWhichMoniker,
  502. LPMONIKER FAR* ppmk) PURE;
  503. STDMETHOD(GetContainer) (THIS_ LPOLECONTAINER FAR* ppContainer) PURE;
  504. STDMETHOD(ShowObject) (THIS) PURE;
  505. STDMETHOD(OnShowWindow) (THIS_ BOOL fShow) PURE;
  506. STDMETHOD(RequestNewObjectLayout) (THIS) PURE;
  507. };
  508. typedef IOleClientSite FAR* LPOLECLIENTSITE;
  509. #undef INTERFACE
  510. #define INTERFACE IParseDisplayName
  511. DECLARE_INTERFACE_(IParseDisplayName, IUnknown)
  512. {
  513. // *** IUnknown methods ***
  514. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  515. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  516. STDMETHOD_(ULONG,Release) (THIS) PURE;
  517. // *** IParseDisplayName method ***
  518. STDMETHOD(ParseDisplayName) (THIS_ LPBC pbc, LPSTR lpszDisplayName,
  519. ULONG FAR* pchEaten, LPMONIKER FAR* ppmkOut) PURE;
  520. };
  521. typedef IParseDisplayName FAR* LPPARSEDISPLAYNAME;
  522. #undef INTERFACE
  523. #define INTERFACE IOleContainer
  524. DECLARE_INTERFACE_(IOleContainer, IParseDisplayName)
  525. {
  526. // *** IUnknown methods ***
  527. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  528. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  529. STDMETHOD_(ULONG,Release) (THIS) PURE;
  530. // *** IParseDisplayName method ***
  531. STDMETHOD(ParseDisplayName) (THIS_ LPBC pbc, LPSTR lpszDisplayName,
  532. ULONG FAR* pchEaten, LPMONIKER FAR* ppmkOut) PURE;
  533. // *** IOleContainer methods ***
  534. STDMETHOD(EnumObjects) ( DWORD grfFlags, LPENUMUNKNOWN FAR* ppenumUnknown) PURE;
  535. STDMETHOD(LockContainer) (THIS_ BOOL fLock) PURE;
  536. };
  537. typedef IOleContainer FAR* LPOLECONTAINER;
  538. typedef enum tagBINDSPEED
  539. {
  540. BINDSPEED_INDEFINITE = 1,
  541. BINDSPEED_MODERATE = 2,
  542. BINDSPEED_IMMEDIATE = 3
  543. } BINDSPEED;
  544. typedef enum tagOLECONTF
  545. {
  546. OLECONTF_EMBEDDINGS = 1,
  547. OLECONTF_LINKS = 2,
  548. OLECONTF_OTHERS = 4,
  549. OLECONTF_ONLYUSER = 8,
  550. OLECONTF_ONLYIFRUNNING = 16
  551. } OLECONTF;
  552. #undef INTERFACE
  553. #define INTERFACE IOleItemContainer
  554. DECLARE_INTERFACE_(IOleItemContainer, IOleContainer)
  555. {
  556. // *** IUnknown methods ***
  557. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  558. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  559. STDMETHOD_(ULONG,Release) (THIS) PURE;
  560. // *** IParseDisplayName method ***
  561. STDMETHOD(ParseDisplayName) (THIS_ LPBC pbc, LPSTR lpszDisplayName,
  562. ULONG FAR* pchEaten, LPMONIKER FAR* ppmkOut) PURE;
  563. // *** IOleContainer methods ***
  564. STDMETHOD(EnumObjects) (THIS_ DWORD grfFlags, LPENUMUNKNOWN FAR* ppenumUnknown) PURE;
  565. STDMETHOD(LockContainer) (THIS_ BOOL fLock) PURE;
  566. // *** IOleItemContainer methods ***
  567. STDMETHOD(GetObject) (THIS_ LPSTR lpszItem, DWORD dwSpeedNeeded,
  568. LPBINDCTX pbc, REFIID riid, LPVOID FAR* ppvObject) PURE;
  569. STDMETHOD(GetObjectStorage) (THIS_ LPSTR lpszItem, LPBINDCTX pbc,
  570. REFIID riid, LPVOID FAR* ppvStorage) PURE;
  571. STDMETHOD(IsRunning) (THIS_ LPSTR lpszItem) PURE;
  572. };
  573. typedef IOleItemContainer FAR* LPOLEITEMCONTAINER;
  574. #undef INTERFACE
  575. #define INTERFACE IOleAdviseHolder
  576. DECLARE_INTERFACE_(IOleAdviseHolder, IUnknown)
  577. {
  578. // *** IUnknown methods ***
  579. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppv) PURE;
  580. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  581. STDMETHOD_(ULONG,Release) (THIS) PURE;
  582. // *** IOleAdviseHolder methods ***
  583. STDMETHOD(Advise)(THIS_ LPADVISESINK pAdvise, DWORD FAR* pdwConnection) PURE;
  584. STDMETHOD(Unadvise)(THIS_ DWORD dwConnection) PURE;
  585. STDMETHOD(EnumAdvise)(THIS_ LPENUMSTATDATA FAR* ppenumAdvise) PURE;
  586. STDMETHOD(SendOnRename)(THIS_ LPMONIKER pmk) PURE;
  587. STDMETHOD(SendOnSave)(THIS) PURE;
  588. STDMETHOD(SendOnClose)(THIS) PURE;
  589. };
  590. typedef IOleAdviseHolder FAR* LPOLEADVISEHOLDER;
  591. /****** OLE Link Interface ************************************************/
  592. /* Link update options */
  593. typedef enum tagOLEUPDATE
  594. {
  595. OLEUPDATE_ALWAYS=1,
  596. OLEUPDATE_ONCALL=3
  597. } OLEUPDATE;
  598. typedef OLEUPDATE FAR* LPOLEUPDATE;
  599. // for IOleLink::BindToSource
  600. typedef enum tagOLELINKBIND
  601. {
  602. OLELINKBIND_EVENIFCLASSDIFF = 1,
  603. } OLELINKBIND;
  604. #undef INTERFACE
  605. #define INTERFACE IOleLink
  606. DECLARE_INTERFACE_(IOleLink, IUnknown)
  607. {
  608. // *** IUnknown methods ***
  609. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  610. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  611. STDMETHOD_(ULONG,Release) (THIS) PURE;
  612. // *** IOleLink methods ***
  613. STDMETHOD(SetUpdateOptions) (THIS_ DWORD dwUpdateOpt) PURE;
  614. STDMETHOD(GetUpdateOptions) (THIS_ LPDWORD pdwUpdateOpt) PURE;
  615. STDMETHOD(SetSourceMoniker) (THIS_ LPMONIKER pmk, REFCLSID rclsid) PURE;
  616. STDMETHOD(GetSourceMoniker) (THIS_ LPMONIKER FAR* ppmk) PURE;
  617. STDMETHOD(SetSourceDisplayName) (THIS_ LPCSTR lpszDisplayName) PURE;
  618. STDMETHOD(GetSourceDisplayName) (THIS_ LPSTR FAR* lplpszDisplayName) PURE;
  619. STDMETHOD(BindToSource) (THIS_ DWORD bindflags, LPBINDCTX pbc) PURE;
  620. STDMETHOD(BindIfRunning) (THIS) PURE;
  621. STDMETHOD(GetBoundSource) (THIS_ LPUNKNOWN FAR* ppUnk) PURE;
  622. STDMETHOD(UnbindSource) (THIS) PURE;
  623. STDMETHOD(Update) (THIS_ LPBINDCTX pbc) PURE;
  624. };
  625. typedef IOleLink FAR* LPOLELINK;
  626. /****** OLE InPlace Editing Interfaces ************************************/
  627. #ifdef _MAC
  628. typedef Handle HOLEMENU;
  629. typedef long SIZE;
  630. typedef long HACCEL;
  631. #else
  632. DECLARE_HANDLE(HOLEMENU);
  633. #endif
  634. typedef struct FARSTRUCT tagOIFI // OleInPlaceFrameInfo
  635. {
  636. UINT cb;
  637. BOOL fMDIApp;
  638. HWND hwndFrame;
  639. HACCEL haccel;
  640. int cAccelEntries;
  641. } OLEINPLACEFRAMEINFO, FAR* LPOLEINPLACEFRAMEINFO;
  642. typedef struct FARSTRUCT tagOleMenuGroupWidths
  643. {
  644. LONG width[6];
  645. } OLEMENUGROUPWIDTHS, FAR* LPOLEMENUGROUPWIDTHS;
  646. typedef RECT BORDERWIDTHS;
  647. typedef LPRECT LPBORDERWIDTHS;
  648. typedef LPCRECT LPCBORDERWIDTHS;
  649. /* Inplace editing specific error codes */
  650. #define INPLACE_E_NOTUNDOABLE (INPLACE_E_FIRST)
  651. // undo is not avaiable
  652. #define INPLACE_E_NOTOOLSPACE (INPLACE_E_FIRST+1)
  653. // Space for tools is not available
  654. #define INPLACE_S_TRUNCATED (INPLACE_S_FIRST)
  655. // Message is too long, some of it had to be truncated before displaying
  656. // forward type declarations
  657. #if defined(__cplusplus)
  658. interface IOleInPlaceUIWindow;
  659. #else
  660. typedef interface IOleInPlaceUIWindow IOleInPlaceUIWindow;
  661. #endif
  662. typedef IOleInPlaceUIWindow FAR* LPOLEINPLACEUIWINDOW;
  663. #undef INTERFACE
  664. #define INTERFACE IOleWindow
  665. DECLARE_INTERFACE_(IOleWindow, IUnknown)
  666. {
  667. // *** IUnknown methods ***
  668. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  669. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  670. STDMETHOD_(ULONG,Release) (THIS) PURE;
  671. // *** IOleWindow methods ***
  672. STDMETHOD(GetWindow) (THIS_ HWND FAR* lphwnd) PURE;
  673. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  674. };
  675. typedef IOleWindow FAR* LPOLEWINDOW;
  676. #undef INTERFACE
  677. #define INTERFACE IOleInPlaceObject
  678. DECLARE_INTERFACE_(IOleInPlaceObject, IOleWindow)
  679. {
  680. // *** IUnknown methods ***
  681. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  682. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  683. STDMETHOD_(ULONG,Release) (THIS) PURE;
  684. // *** IOleWindow methods ***
  685. STDMETHOD(GetWindow) (THIS_ HWND FAR* lphwnd) PURE;
  686. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  687. // *** IOleInPlaceObject methods ***
  688. STDMETHOD(InPlaceDeactivate) (THIS) PURE;
  689. STDMETHOD(UIDeactivate) (THIS) PURE;
  690. STDMETHOD(SetObjectRects) (THIS_ LPCRECT lprcPosRect,
  691. LPCRECT lprcClipRect) PURE;
  692. STDMETHOD(ReactivateAndUndo) (THIS) PURE;
  693. };
  694. typedef IOleInPlaceObject FAR* LPOLEINPLACEOBJECT;
  695. #undef INTERFACE
  696. #define INTERFACE IOleInPlaceActiveObject
  697. DECLARE_INTERFACE_(IOleInPlaceActiveObject, IOleWindow)
  698. {
  699. // *** IUnknown methods ***
  700. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  701. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  702. STDMETHOD_(ULONG,Release) (THIS) PURE;
  703. // *** IOleWindow methods ***
  704. STDMETHOD(GetWindow) (THIS_ HWND FAR* lphwnd) PURE;
  705. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  706. // *** IOleInPlaceActiveObject methods ***
  707. STDMETHOD(TranslateAccelerator) (THIS_ LPMSG lpmsg) PURE;
  708. STDMETHOD(OnFrameWindowActivate) (THIS_ BOOL fActivate) PURE;
  709. STDMETHOD(OnDocWindowActivate) (THIS_ BOOL fActivate) PURE;
  710. STDMETHOD(ResizeBorder) (THIS_ LPCRECT lprectBorder, LPOLEINPLACEUIWINDOW lpUIWindow, BOOL fFrameWindow) PURE;
  711. STDMETHOD(EnableModeless) (THIS_ BOOL fEnable) PURE;
  712. };
  713. typedef IOleInPlaceActiveObject FAR* LPOLEINPLACEACTIVEOBJECT;
  714. #undef INTERFACE
  715. #define INTERFACE IOleInPlaceUIWindow
  716. DECLARE_INTERFACE_(IOleInPlaceUIWindow, IOleWindow)
  717. {
  718. // *** IUnknown methods ***
  719. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  720. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  721. STDMETHOD_(ULONG,Release) (THIS) PURE;
  722. // *** IOleWindow methods ***
  723. STDMETHOD(GetWindow) (THIS_ HWND FAR* lphwnd) PURE;
  724. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  725. // *** IOleInPlaceUIWindow methods ***
  726. STDMETHOD(GetBorder) (THIS_ LPRECT lprectBorder) PURE;
  727. STDMETHOD(RequestBorderSpace) (THIS_ LPCBORDERWIDTHS lpborderwidths) PURE;
  728. STDMETHOD(SetBorderSpace) (THIS_ LPCBORDERWIDTHS lpborderwidths) PURE;
  729. STDMETHOD(SetActiveObject) (THIS_ LPOLEINPLACEACTIVEOBJECT lpActiveObject,
  730. LPCSTR lpszObjName) PURE;
  731. };
  732. typedef IOleInPlaceUIWindow FAR* LPOLEINPLACEUIWINDOW;
  733. #undef INTERFACE
  734. #define INTERFACE IOleInPlaceFrame
  735. DECLARE_INTERFACE_(IOleInPlaceFrame, IOleInPlaceUIWindow)
  736. {
  737. // *** IUnknown methods ***
  738. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  739. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  740. STDMETHOD_(ULONG,Release) (THIS) PURE;
  741. // *** IOleWindow methods ***
  742. STDMETHOD(GetWindow) (THIS_ HWND FAR* lphwnd) PURE;
  743. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  744. // *** IOleInPlaceUIWindow methods ***
  745. STDMETHOD(GetBorder) (THIS_ LPRECT lprectBorder) PURE;
  746. STDMETHOD(RequestBorderSpace) (THIS_ LPCBORDERWIDTHS lpborderwidths) PURE;
  747. STDMETHOD(SetBorderSpace) (THIS_ LPCBORDERWIDTHS lpborderwidths) PURE;
  748. STDMETHOD(SetActiveObject) (THIS_ LPOLEINPLACEACTIVEOBJECT lpActiveObject,
  749. LPCSTR lpszObjName) PURE;
  750. // *** IOleInPlaceFrame methods ***
  751. STDMETHOD(InsertMenus) (THIS_ HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) PURE;
  752. STDMETHOD(SetMenu) (THIS_ HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject) PURE;
  753. STDMETHOD(RemoveMenus) (THIS_ HMENU hmenuShared) PURE;
  754. STDMETHOD(SetStatusText) (THIS_ LPCSTR lpszStatusText) PURE;
  755. STDMETHOD(EnableModeless) (THIS_ BOOL fEnable) PURE;
  756. STDMETHOD(TranslateAccelerator) (THIS_ LPMSG lpmsg, WORD wID) PURE;
  757. };
  758. typedef IOleInPlaceFrame FAR* LPOLEINPLACEFRAME;
  759. #undef INTERFACE
  760. #define INTERFACE IOleInPlaceSite
  761. DECLARE_INTERFACE_(IOleInPlaceSite, IOleWindow)
  762. {
  763. // *** IUnknown methods ***
  764. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  765. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  766. STDMETHOD_(ULONG,Release) (THIS) PURE;
  767. // *** IOleWindow methods ***
  768. STDMETHOD(GetWindow) (THIS_ HWND FAR* lphwnd) PURE;
  769. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  770. // *** IOleInPlaceSite methods ***
  771. STDMETHOD(CanInPlaceActivate) (THIS) PURE;
  772. STDMETHOD(OnInPlaceActivate) (THIS) PURE;
  773. STDMETHOD(OnUIActivate) (THIS) PURE;
  774. STDMETHOD(GetWindowContext) (THIS_ LPOLEINPLACEFRAME FAR* lplpFrame,
  775. LPOLEINPLACEUIWINDOW FAR* lplpDoc,
  776. LPRECT lprcPosRect,
  777. LPRECT lprcClipRect,
  778. LPOLEINPLACEFRAMEINFO lpFrameInfo) PURE;
  779. STDMETHOD(Scroll) (THIS_ SIZE scrollExtent) PURE;
  780. STDMETHOD(OnUIDeactivate) (THIS_ BOOL fUndoable) PURE;
  781. STDMETHOD(OnInPlaceDeactivate) (THIS) PURE;
  782. STDMETHOD(DiscardUndoState) (THIS) PURE;
  783. STDMETHOD(DeactivateAndUndo) (THIS) PURE;
  784. STDMETHOD(OnPosRectChange) (THIS_ LPCRECT lprcPosRect) PURE;
  785. };
  786. typedef IOleInPlaceSite FAR* LPOLEINPLACESITE;
  787. /****** OLE API Prototypes ************************************************/
  788. STDAPI_(DWORD) OleBuildVersion( VOID );
  789. /* helper functions */
  790. STDAPI ReadClassStg(LPSTORAGE pStg, CLSID FAR* pclsid);
  791. STDAPI WriteClassStg(LPSTORAGE pStg, REFCLSID rclsid);
  792. STDAPI ReadClassStm(LPSTREAM pStm, CLSID FAR* pclsid);
  793. STDAPI WriteClassStm(LPSTREAM pStm, REFCLSID rclsid);
  794. STDAPI WriteFmtUserTypeStg (LPSTORAGE pstg, CLIPFORMAT cf, LPSTR lpszUserType);
  795. STDAPI ReadFmtUserTypeStg (LPSTORAGE pstg, CLIPFORMAT FAR* pcf, LPSTR FAR* lplpszUserType);
  796. /* init/term */
  797. STDAPI OleInitialize(LPMALLOC pMalloc);
  798. STDAPI_(void) OleUninitialize(void);
  799. /* APIs to query whether (Embedded/Linked) object can be created from
  800. the data object */
  801. STDAPI OleQueryLinkFromData(LPDATAOBJECT pSrcDataObject);
  802. STDAPI OleQueryCreateFromData(LPDATAOBJECT pSrcDataObject);
  803. /* Object creation APIs */
  804. STDAPI OleCreate(REFCLSID rclsid, REFIID riid, DWORD renderopt,
  805. LPFORMATETC pFormatEtc, LPOLECLIENTSITE pClientSite,
  806. LPSTORAGE pStg, LPVOID FAR* ppvObj);
  807. STDAPI OleCreateFromData(LPDATAOBJECT pSrcDataObj, REFIID riid,
  808. DWORD renderopt, LPFORMATETC pFormatEtc,
  809. LPOLECLIENTSITE pClientSite, LPSTORAGE pStg,
  810. LPVOID FAR* ppvObj);
  811. STDAPI OleCreateLinkFromData(LPDATAOBJECT pSrcDataObj, REFIID riid,
  812. DWORD renderopt, LPFORMATETC pFormatEtc,
  813. LPOLECLIENTSITE pClientSite, LPSTORAGE pStg,
  814. LPVOID FAR* ppvObj);
  815. STDAPI OleCreateStaticFromData(LPDATAOBJECT pSrcDataObj, REFIID iid,
  816. DWORD renderopt, LPFORMATETC pFormatEtc,
  817. LPOLECLIENTSITE pClientSite, LPSTORAGE pStg,
  818. LPVOID FAR* ppvObj);
  819. STDAPI OleCreateLink(LPMONIKER pmkLinkSrc, REFIID riid,
  820. DWORD renderopt, LPFORMATETC lpFormatEtc,
  821. LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID FAR* ppvObj);
  822. STDAPI OleCreateLinkToFile(LPCSTR lpszFileName, REFIID riid,
  823. DWORD renderopt, LPFORMATETC lpFormatEtc,
  824. LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID FAR* ppvObj);
  825. STDAPI OleCreateFromFile(REFCLSID rclsid, LPCSTR lpszFileName, REFIID riid,
  826. DWORD renderopt, LPFORMATETC lpFormatEtc,
  827. LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID FAR* ppvObj);
  828. STDAPI OleLoad(LPSTORAGE pStg, REFIID riid, LPOLECLIENTSITE pClientSite,
  829. LPVOID FAR* ppvObj);
  830. STDAPI OleSave(LPPERSISTSTORAGE pPS, LPSTORAGE pStg, BOOL fSameAsLoad);
  831. STDAPI OleLoadFromStream( LPSTREAM pStm, REFIID iidInterface, LPVOID FAR* ppvObj);
  832. STDAPI OleSaveToStream( LPPERSISTSTREAM pPStm, LPSTREAM pStm );
  833. STDAPI OleSetContainedObject(LPUNKNOWN pUnknown, BOOL fContained);
  834. STDAPI OleNoteObjectVisible(LPUNKNOWN pUnknown, BOOL fVisible);
  835. /* Drag/Drop APIs */
  836. STDAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget);
  837. STDAPI RevokeDragDrop(HWND hwnd);
  838. STDAPI DoDragDrop(LPDATAOBJECT pDataObj, LPDROPSOURCE pDropSource,
  839. DWORD dwOKEffects, LPDWORD pdwEffect);
  840. /* Clipboard APIs */
  841. STDAPI OleSetClipboard(LPDATAOBJECT pDataObj);
  842. STDAPI OleGetClipboard(LPDATAOBJECT FAR* ppDataObj);
  843. STDAPI OleFlushClipboard(void);
  844. STDAPI OleIsCurrentClipboard(LPDATAOBJECT pDataObj);
  845. /* InPlace Editing APIs */
  846. STDAPI_(HOLEMENU) OleCreateMenuDescriptor (HMENU hmenuCombined,
  847. LPOLEMENUGROUPWIDTHS lpMenuWidths);
  848. STDAPI OleSetMenuDescriptor (HOLEMENU holemenu, HWND hwndFrame,
  849. HWND hwndActiveObject,
  850. LPOLEINPLACEFRAME lpFrame,
  851. LPOLEINPLACEACTIVEOBJECT lpActiveObj);
  852. STDAPI OleDestroyMenuDescriptor (HOLEMENU holemenu);
  853. STDAPI OleTranslateAccelerator (LPOLEINPLACEFRAME lpFrame,
  854. LPOLEINPLACEFRAMEINFO lpFrameInfo, LPMSG lpmsg);
  855. /* Helper APIs */
  856. STDAPI_(HANDLE) OleDuplicateData (HANDLE hSrc, CLIPFORMAT cfFormat,
  857. UINT uiFlags);
  858. STDAPI OleDraw (LPUNKNOWN pUnknown, DWORD dwAspect, HDC hdcDraw,
  859. LPCRECT lprcBounds);
  860. STDAPI OleRun(LPUNKNOWN pUnknown);
  861. STDAPI_(BOOL) OleIsRunning(LPOLEOBJECT pObject);
  862. STDAPI_(void) ReleaseStgMedium(LPSTGMEDIUM);
  863. STDAPI CreateOleAdviseHolder(LPOLEADVISEHOLDER FAR* ppOAHolder);
  864. STDAPI OleCreateDefaultHandler(REFCLSID clsid, LPUNKNOWN pUnkOuter,
  865. REFIID riid, LPVOID FAR* lplpObj);
  866. /* OLE 1.0 conversion APIS */
  867. STDAPI OleConvertOLESTREAMToIStorage
  868. (LPOLESTREAM lpolestream,
  869. LPSTORAGE pstg,
  870. const DVTARGETDEVICE FAR* ptd);
  871. STDAPI OleConvertIStorageToOLESTREAM
  872. (LPSTORAGE pstg,
  873. LPOLESTREAM lpolestream);
  874. /* Storage Utility APIs */
  875. STDAPI GetHGlobalFromILockBytes (LPLOCKBYTES plkbyt, HGLOBAL FAR* phglobal);
  876. STDAPI CreateILockBytesOnHGlobal (HGLOBAL hGlobal, BOOL fDeleteOnRelease,
  877. LPLOCKBYTES FAR* pplkbyt);
  878. STDAPI GetHGlobalFromStream (LPSTREAM pstm, HGLOBAL FAR* phglobal);
  879. STDAPI CreateStreamOnHGlobal (HGLOBAL hGlobal, BOOL fDeleteOnRelease,
  880. LPSTREAM FAR* ppstm);
  881. /* ConvertTo APIS */
  882. STDAPI OleDoAutoConvert(LPSTORAGE pStg, LPCLSID pClsidNew);
  883. STDAPI OleGetAutoConvert(REFCLSID clsidOld, LPCLSID pClsidNew);
  884. STDAPI OleSetAutoConvert(REFCLSID clsidOld, REFCLSID clsidNew);
  885. STDAPI GetConvertStg(LPSTORAGE pStg);
  886. STDAPI SetConvertStg(LPSTORAGE pStg, BOOL fConvert);
  887. #endif // _OLE2_H_