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.

1336 lines
45 KiB

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