Source code of Windows XP (NT5)
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.

505 lines
25 KiB

  1. /*****************************************************************************\
  2. * *
  3. * ole.h - Object Linking and Embedding functions, types, and definitions*
  4. * *
  5. * Version 1.0 *
  6. * *
  7. * NOTE: windows.h must be #included first *
  8. * *
  9. * Copyright (c) 1990-1993, Microsoft Corp. All rights reserved.*
  10. * *
  11. \*****************************************************************************/
  12. #ifndef _INC_OLE
  13. #define _INC_OLE
  14. #ifdef WIN16
  15. #ifndef RC_INVOKED
  16. #pragma pack(1) /* Assume byte packing throughout */
  17. #endif /* !RC_INVOKED */
  18. #endif
  19. #ifdef __cplusplus
  20. extern "C" { /* Assume C declarations for C++ */
  21. #endif /* __cplusplus */
  22. #ifndef WINAPI /* If not included with 3.1 headers... */
  23. #define WINAPI FAR PASCAL
  24. #define CALLBACK FAR PASCAL
  25. #define LPCSTR LPSTR
  26. #define LRESULT LONG
  27. #define HGLOBAL HANDLE
  28. #endif /* _INC_WINDOWS */
  29. #ifdef STRICT
  30. #define OLE_LPCSTR LPCSTR
  31. #define OLE_CONST const
  32. #else /* STRICT */
  33. #define OLE_LPCSTR LPSTR
  34. #define OLE_CONST
  35. #endif /* !STRICT */
  36. #define LRESULT LONG
  37. #define HGLOBAL HANDLE
  38. /* Object types */
  39. #define OT_LINK 1L
  40. #define OT_EMBEDDED 2L
  41. #define OT_STATIC 3L
  42. /* activate verbs */
  43. #define OLEVERB_PRIMARY 0
  44. /* target device info structure */
  45. typedef struct _OLETARGETDEVICE
  46. {
  47. UINT otdDeviceNameOffset;
  48. UINT otdDriverNameOffset;
  49. UINT otdPortNameOffset;
  50. UINT otdExtDevmodeOffset;
  51. UINT otdExtDevmodeSize;
  52. UINT otdEnvironmentOffset;
  53. UINT otdEnvironmentSize;
  54. BYTE otdData[1];
  55. } OLETARGETDEVICE;
  56. typedef OLETARGETDEVICE FAR* LPOLETARGETDEVICE;
  57. /* flags used in some methods */
  58. #define OF_SET 0x0001
  59. #define OF_GET 0x0002
  60. #define OF_HANDLER 0x0004
  61. /* return codes for OLE functions */
  62. typedef enum
  63. {
  64. OLE_OK, /* 0 Function operated correctly */
  65. OLE_WAIT_FOR_RELEASE, /* 1 Command has been initiated, client */
  66. /* must wait for release. keep dispatching */
  67. /* messages till OLE_RELESE in callback */
  68. OLE_BUSY, /* 2 Tried to execute a method while another */
  69. /* method is in progress. */
  70. OLE_ERROR_PROTECT_ONLY, /* 3 Ole APIs are called in real mode */
  71. OLE_ERROR_MEMORY, /* 4 Could not alloc or lock memory */
  72. OLE_ERROR_STREAM, /* 5 (OLESTREAM) stream error */
  73. OLE_ERROR_STATIC, /* 6 Non static object expected */
  74. OLE_ERROR_BLANK, /* 7 Critical data missing */
  75. OLE_ERROR_DRAW, /* 8 Error while drawing */
  76. OLE_ERROR_METAFILE, /* 9 Invalid metafile */
  77. OLE_ERROR_ABORT, /* 10 Client chose to abort metafile drawing */
  78. OLE_ERROR_CLIPBOARD, /* 11 Failed to get/set clipboard data */
  79. OLE_ERROR_FORMAT, /* 12 Requested format is not available */
  80. OLE_ERROR_OBJECT, /* 13 Not a valid object */
  81. OLE_ERROR_OPTION, /* 14 Invalid option(link update / render) */
  82. OLE_ERROR_PROTOCOL, /* 15 Invalid protocol */
  83. OLE_ERROR_ADDRESS, /* 16 One of the pointers is invalid */
  84. OLE_ERROR_NOT_EQUAL, /* 17 Objects are not equal */
  85. OLE_ERROR_HANDLE, /* 18 Invalid handle encountered */
  86. OLE_ERROR_GENERIC, /* 19 Some general error */
  87. OLE_ERROR_CLASS, /* 20 Invalid class */
  88. OLE_ERROR_SYNTAX, /* 21 Command syntax is invalid */
  89. OLE_ERROR_DATATYPE, /* 22 Data format is not supported */
  90. OLE_ERROR_PALETTE, /* 23 Invalid color palette */
  91. OLE_ERROR_NOT_LINK, /* 24 Not a linked object */
  92. OLE_ERROR_NOT_EMPTY, /* 25 Client doc contains objects. */
  93. OLE_ERROR_SIZE, /* 26 Incorrect buffer size passed to the api */
  94. /* that places some string in caller's */
  95. /* buffer */
  96. OLE_ERROR_DRIVE, /* 27 Drive letter in doc name is invalid */
  97. OLE_ERROR_NETWORK, /* 28 Failed to establish connection to a */
  98. /* network share on which the document */
  99. /* is located */
  100. OLE_ERROR_NAME, /* 29 Invalid name(doc name, object name), */
  101. /* etc.. passed to the APIs */
  102. OLE_ERROR_TEMPLATE, /* 30 Server failed to load template */
  103. OLE_ERROR_NEW, /* 31 Server failed to create new doc */
  104. OLE_ERROR_EDIT, /* 32 Server failed to create embedded */
  105. /* instance */
  106. OLE_ERROR_OPEN, /* 33 Server failed to open document, */
  107. /* possible invalid link */
  108. OLE_ERROR_NOT_OPEN, /* 34 Object is not open for editing */
  109. OLE_ERROR_LAUNCH, /* 35 Failed to launch server */
  110. OLE_ERROR_COMM, /* 36 Failed to communicate with server */
  111. OLE_ERROR_TERMINATE, /* 37 Error in termination */
  112. OLE_ERROR_COMMAND, /* 38 Error in execute */
  113. OLE_ERROR_SHOW, /* 39 Error in show */
  114. OLE_ERROR_DOVERB, /* 40 Error in sending do verb, or invalid */
  115. /* verb */
  116. OLE_ERROR_ADVISE_NATIVE, /* 41 Item could be missing */
  117. OLE_ERROR_ADVISE_PICT, /* 42 Item could be missing or server doesn't */
  118. /* this format. */
  119. OLE_ERROR_ADVISE_RENAME, /* 43 Server doesn't support rename */
  120. OLE_ERROR_POKE_NATIVE, /* 44 Failure of poking native data to server */
  121. OLE_ERROR_REQUEST_NATIVE, /* 45 Server failed to render native data */
  122. OLE_ERROR_REQUEST_PICT, /* 46 Server failed to render presentation */
  123. /* data */
  124. OLE_ERROR_SERVER_BLOCKED, /* 47 Trying to block a blocked server or */
  125. /* trying to revoke a blocked server */
  126. /* or document */
  127. OLE_ERROR_REGISTRATION, /* 48 Server is not registered in regestation */
  128. /* data base */
  129. OLE_ERROR_ALREADY_REGISTERED,/*49 Trying to register same doc multiple */
  130. /* times */
  131. OLE_ERROR_TASK, /* 50 Server or client task is invalid */
  132. OLE_ERROR_OUTOFDATE, /* 51 Object is out of date */
  133. OLE_ERROR_CANT_UPDATE_CLIENT,/* 52 Embed doc's client doesn't accept */
  134. /* updates */
  135. OLE_ERROR_UPDATE, /* 53 erorr while trying to update */
  136. OLE_ERROR_SETDATA_FORMAT, /* 54 Server app doesn't understand the */
  137. /* format given to its SetData method */
  138. OLE_ERROR_STATIC_FROM_OTHER_OS,/* 55 trying to load a static object created */
  139. /* on another Operating System */
  140. OLE_ERROR_FILE_VER,
  141. /* Following are warnings */
  142. OLE_WARN_DELETE_DATA = 1000 /* Caller must delete the data when he is */
  143. /* done with it. */
  144. } OLESTATUS;
  145. /* Codes for CallBack events */
  146. typedef enum
  147. {
  148. OLE_CHANGED, /* 0 */
  149. OLE_SAVED, /* 1 */
  150. OLE_CLOSED, /* 2 */
  151. OLE_RENAMED, /* 3 */
  152. OLE_QUERY_PAINT, /* 4 Interruptible paint support */
  153. OLE_RELEASE, /* 5 Object is released(asynchronous operation */
  154. /* is completed) */
  155. OLE_QUERY_RETRY /* 6 Query for retry when server sends busy ACK */
  156. } OLE_NOTIFICATION;
  157. typedef enum
  158. {
  159. OLE_NONE, /* 0 no method active */
  160. OLE_DELETE, /* 1 object delete */
  161. OLE_LNKPASTE, /* 2 PasteLink(auto reconnect) */
  162. OLE_EMBPASTE, /* 3 paste(and update) */
  163. OLE_SHOW, /* 4 Show */
  164. OLE_RUN, /* 5 Run */
  165. OLE_ACTIVATE, /* 6 Activate */
  166. OLE_UPDATE, /* 7 Update */
  167. OLE_CLOSE, /* 8 Close */
  168. OLE_RECONNECT, /* 9 Reconnect */
  169. OLE_SETUPDATEOPTIONS, /* 10 setting update options */
  170. OLE_SERVERUNLAUNCH, /* 11 server is being unlaunched */
  171. OLE_LOADFROMSTREAM, /* 12 LoadFromStream(auto reconnect) */
  172. OLE_SETDATA, /* 13 OleSetData */
  173. OLE_REQUESTDATA, /* 14 OleRequestData */
  174. OLE_OTHER, /* 15 other misc async operations */
  175. OLE_CREATE, /* 16 create */
  176. OLE_CREATEFROMTEMPLATE, /* 17 CreatefromTemplate */
  177. OLE_CREATELINKFROMFILE, /* 18 CreateLinkFromFile */
  178. OLE_COPYFROMLNK, /* 19 CopyFromLink(auto reconnect) */
  179. OLE_CREATEFROMFILE, /* 20 CreateFromFile */
  180. OLE_CREATEINVISIBLE /* 21 CreateInvisible */
  181. } OLE_RELEASE_METHOD;
  182. /* rendering options */
  183. typedef enum
  184. {
  185. olerender_none,
  186. olerender_draw,
  187. olerender_format
  188. } OLEOPT_RENDER;
  189. /* standard clipboard format type */
  190. typedef WORD OLECLIPFORMAT;
  191. /* Link update options */
  192. typedef enum
  193. {
  194. oleupdate_always,
  195. oleupdate_onsave,
  196. #ifdef OLE_INTERNAL
  197. oleupdate_oncall,
  198. oleupdate_onclose
  199. #else
  200. oleupdate_oncall
  201. #endif /* OLE_INTERNAL */
  202. } OLEOPT_UPDATE;
  203. typedef HANDLE HOBJECT;
  204. typedef LONG LHSERVER;
  205. typedef LONG LHCLIENTDOC;
  206. typedef LONG LHSERVERDOC;
  207. typedef struct _OLEOBJECT FAR* LPOLEOBJECT;
  208. typedef struct _OLESTREAM FAR* LPOLESTREAM;
  209. typedef struct _OLECLIENT FAR* LPOLECLIENT;
  210. /* object method table definitions. */
  211. typedef struct _OLEOBJECTVTBL
  212. {
  213. void FAR* (CALLBACK* QueryProtocol) (LPOLEOBJECT, OLE_LPCSTR);
  214. OLESTATUS (CALLBACK* Release) (LPOLEOBJECT);
  215. OLESTATUS (CALLBACK* Show) (LPOLEOBJECT, BOOL);
  216. OLESTATUS (CALLBACK* DoVerb) (LPOLEOBJECT, UINT, BOOL, BOOL);
  217. OLESTATUS (CALLBACK* GetData) (LPOLEOBJECT, OLECLIPFORMAT, HANDLE FAR*);
  218. OLESTATUS (CALLBACK* SetData) (LPOLEOBJECT, OLECLIPFORMAT, HANDLE);
  219. OLESTATUS (CALLBACK* SetTargetDevice) (LPOLEOBJECT, HGLOBAL);
  220. OLESTATUS (CALLBACK* SetBounds) (LPOLEOBJECT, OLE_CONST RECT FAR*);
  221. OLECLIPFORMAT (CALLBACK* EnumFormats) (LPOLEOBJECT, OLECLIPFORMAT);
  222. OLESTATUS (CALLBACK* SetColorScheme) (LPOLEOBJECT, OLE_CONST LOGPALETTE FAR*);
  223. /* Server has to implement only the above methods. */
  224. #ifndef SERVERONLY
  225. /* Extra methods required for client. */
  226. OLESTATUS (CALLBACK* Delete) (LPOLEOBJECT);
  227. OLESTATUS (CALLBACK* SetHostNames) (LPOLEOBJECT, OLE_LPCSTR, OLE_LPCSTR);
  228. OLESTATUS (CALLBACK* SaveToStream) (LPOLEOBJECT, LPOLESTREAM);
  229. OLESTATUS (CALLBACK* Clone) (LPOLEOBJECT, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR*);
  230. OLESTATUS (CALLBACK* CopyFromLink) (LPOLEOBJECT, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR*);
  231. OLESTATUS (CALLBACK* Equal) (LPOLEOBJECT, LPOLEOBJECT);
  232. OLESTATUS (CALLBACK* CopyToClipboard) (LPOLEOBJECT);
  233. OLESTATUS (CALLBACK* Draw) (LPOLEOBJECT, HDC, OLE_CONST RECT FAR*, OLE_CONST RECT FAR*, HDC);
  234. OLESTATUS (CALLBACK* Activate) (LPOLEOBJECT, UINT, BOOL, BOOL, HWND, OLE_CONST RECT FAR*);
  235. OLESTATUS (CALLBACK* Execute) (LPOLEOBJECT, HGLOBAL, UINT);
  236. OLESTATUS (CALLBACK* Close) (LPOLEOBJECT);
  237. OLESTATUS (CALLBACK* Update) (LPOLEOBJECT);
  238. OLESTATUS (CALLBACK* Reconnect) (LPOLEOBJECT);
  239. OLESTATUS (CALLBACK* ObjectConvert) (LPOLEOBJECT, OLE_LPCSTR, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR*);
  240. OLESTATUS (CALLBACK* GetLinkUpdateOptions) (LPOLEOBJECT, OLEOPT_UPDATE FAR*);
  241. OLESTATUS (CALLBACK* SetLinkUpdateOptions) (LPOLEOBJECT, OLEOPT_UPDATE);
  242. OLESTATUS (CALLBACK* Rename) (LPOLEOBJECT, OLE_LPCSTR);
  243. OLESTATUS (CALLBACK* QueryName) (LPOLEOBJECT, LPSTR, UINT FAR*);
  244. OLESTATUS (CALLBACK* QueryType) (LPOLEOBJECT, LONG FAR*);
  245. OLESTATUS (CALLBACK* QueryBounds) (LPOLEOBJECT, RECT FAR*);
  246. OLESTATUS (CALLBACK* QuerySize) (LPOLEOBJECT, DWORD FAR*);
  247. OLESTATUS (CALLBACK* QueryOpen) (LPOLEOBJECT);
  248. OLESTATUS (CALLBACK* QueryOutOfDate) (LPOLEOBJECT);
  249. OLESTATUS (CALLBACK* QueryReleaseStatus) (LPOLEOBJECT);
  250. OLESTATUS (CALLBACK* QueryReleaseError) (LPOLEOBJECT);
  251. OLE_RELEASE_METHOD (CALLBACK* QueryReleaseMethod)(LPOLEOBJECT);
  252. OLESTATUS (CALLBACK* RequestData) (LPOLEOBJECT, OLECLIPFORMAT);
  253. OLESTATUS (CALLBACK* ObjectLong) (LPOLEOBJECT, UINT, LONG FAR*);
  254. /* This method is internal only */
  255. OLESTATUS (CALLBACK* ChangeData) (LPOLEOBJECT, HANDLE, LPOLECLIENT, BOOL);
  256. #endif /* !SERVERONLY */
  257. } OLEOBJECTVTBL;
  258. typedef OLEOBJECTVTBL FAR* LPOLEOBJECTVTBL;
  259. #ifndef OLE_INTERNAL
  260. typedef struct _OLEOBJECT
  261. {
  262. LPOLEOBJECTVTBL lpvtbl;
  263. } OLEOBJECT;
  264. #endif
  265. /* ole client definitions */
  266. typedef struct _OLECLIENTVTBL
  267. {
  268. int (CALLBACK* CallBack)(LPOLECLIENT, OLE_NOTIFICATION, LPOLEOBJECT);
  269. } OLECLIENTVTBL;
  270. typedef OLECLIENTVTBL FAR* LPOLECLIENTVTBL;
  271. typedef struct _OLECLIENT
  272. {
  273. LPOLECLIENTVTBL lpvtbl;
  274. } OLECLIENT;
  275. /* Stream definitions */
  276. typedef struct _OLESTREAMVTBL
  277. {
  278. DWORD (CALLBACK* Get)(LPOLESTREAM, void FAR*, DWORD);
  279. DWORD (CALLBACK* Put)(LPOLESTREAM, OLE_CONST void FAR*, DWORD);
  280. } OLESTREAMVTBL;
  281. typedef OLESTREAMVTBL FAR* LPOLESTREAMVTBL;
  282. typedef struct _OLESTREAM
  283. {
  284. LPOLESTREAMVTBL lpstbl;
  285. } OLESTREAM;
  286. /* Public Function Prototypes */
  287. OLESTATUS WINAPI OleDelete(LPOLEOBJECT);
  288. OLESTATUS WINAPI OleRelease(LPOLEOBJECT);
  289. OLESTATUS WINAPI OleSaveToStream(LPOLEOBJECT, LPOLESTREAM);
  290. OLESTATUS WINAPI OleEqual(LPOLEOBJECT, LPOLEOBJECT );
  291. OLESTATUS WINAPI OleCopyToClipboard(LPOLEOBJECT);
  292. OLESTATUS WINAPI OleSetHostNames(LPOLEOBJECT, LPCSTR, LPCSTR);
  293. OLESTATUS WINAPI OleSetTargetDevice(LPOLEOBJECT, HGLOBAL);
  294. OLESTATUS WINAPI OleSetBounds(LPOLEOBJECT, const RECT FAR*);
  295. OLESTATUS WINAPI OleSetColorScheme(LPOLEOBJECT, const LOGPALETTE FAR*);
  296. OLESTATUS WINAPI OleQueryBounds(LPOLEOBJECT, RECT FAR*);
  297. OLESTATUS WINAPI OleQuerySize(LPOLEOBJECT, DWORD FAR*);
  298. OLESTATUS WINAPI OleDraw(LPOLEOBJECT, HDC, const RECT FAR*, const RECT FAR*, HDC);
  299. OLESTATUS WINAPI OleQueryOpen(LPOLEOBJECT);
  300. OLESTATUS WINAPI OleActivate(LPOLEOBJECT, UINT, BOOL, BOOL, HWND, const RECT FAR*);
  301. OLESTATUS WINAPI OleExecute(LPOLEOBJECT, HGLOBAL, UINT);
  302. OLESTATUS WINAPI OleClose(LPOLEOBJECT);
  303. OLESTATUS WINAPI OleUpdate(LPOLEOBJECT);
  304. OLESTATUS WINAPI OleReconnect(LPOLEOBJECT);
  305. OLESTATUS WINAPI OleGetLinkUpdateOptions(LPOLEOBJECT, OLEOPT_UPDATE FAR*);
  306. OLESTATUS WINAPI OleSetLinkUpdateOptions(LPOLEOBJECT, OLEOPT_UPDATE);
  307. void FAR* WINAPI OleQueryProtocol(LPOLEOBJECT, LPCSTR);
  308. /* Routines related to asynchronous operations. */
  309. OLESTATUS WINAPI OleQueryReleaseStatus(LPOLEOBJECT);
  310. OLESTATUS WINAPI OleQueryReleaseError(LPOLEOBJECT);
  311. OLE_RELEASE_METHOD WINAPI OleQueryReleaseMethod(LPOLEOBJECT);
  312. OLESTATUS WINAPI OleQueryType(LPOLEOBJECT, LONG FAR*);
  313. /* LOWORD is major version, HIWORD is minor version */
  314. DWORD WINAPI OleQueryClientVersion(void);
  315. DWORD WINAPI OleQueryServerVersion(void);
  316. /* Converting to format (as in clipboard): */
  317. OLECLIPFORMAT WINAPI OleEnumFormats(LPOLEOBJECT, OLECLIPFORMAT);
  318. OLESTATUS WINAPI OleGetData(LPOLEOBJECT, OLECLIPFORMAT, HANDLE FAR*);
  319. OLESTATUS WINAPI OleSetData(LPOLEOBJECT, OLECLIPFORMAT, HANDLE);
  320. OLESTATUS WINAPI OleQueryOutOfDate(LPOLEOBJECT);
  321. OLESTATUS WINAPI OleRequestData(LPOLEOBJECT, OLECLIPFORMAT);
  322. /* Query apis for creation from clipboard */
  323. OLESTATUS WINAPI OleQueryLinkFromClip(LPCSTR, OLEOPT_RENDER, OLECLIPFORMAT);
  324. OLESTATUS WINAPI OleQueryCreateFromClip(LPCSTR, OLEOPT_RENDER, OLECLIPFORMAT);
  325. /* Object creation functions */
  326. OLESTATUS WINAPI OleCreateFromClip(LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  327. OLESTATUS WINAPI OleCreateLinkFromClip(LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  328. OLESTATUS WINAPI OleCreateFromFile(LPCSTR, LPOLECLIENT, LPCSTR, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  329. OLESTATUS WINAPI OleCreateLinkFromFile(LPCSTR, LPOLECLIENT, LPCSTR, LPCSTR, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  330. OLESTATUS WINAPI OleLoadFromStream(LPOLESTREAM, LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
  331. OLESTATUS WINAPI OleCreate(LPCSTR, LPOLECLIENT, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  332. OLESTATUS WINAPI OleCreateInvisible(LPCSTR, LPOLECLIENT, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT, BOOL);
  333. OLESTATUS WINAPI OleCreateFromTemplate(LPCSTR, LPOLECLIENT, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  334. OLESTATUS WINAPI OleClone(LPOLEOBJECT, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
  335. OLESTATUS WINAPI OleCopyFromLink(LPOLEOBJECT, LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
  336. OLESTATUS WINAPI OleObjectConvert(LPOLEOBJECT, LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
  337. OLESTATUS WINAPI OleRename(LPOLEOBJECT, LPCSTR);
  338. OLESTATUS WINAPI OleQueryName(LPOLEOBJECT, LPSTR, UINT FAR*);
  339. OLESTATUS WINAPI OleRevokeObject(LPOLECLIENT);
  340. BOOL WINAPI OleIsDcMeta(HDC);
  341. /* client document API */
  342. OLESTATUS WINAPI OleRegisterClientDoc(LPCSTR, LPCSTR, LONG, LHCLIENTDOC FAR*);
  343. OLESTATUS WINAPI OleRevokeClientDoc(LHCLIENTDOC);
  344. OLESTATUS WINAPI OleRenameClientDoc(LHCLIENTDOC, LPCSTR);
  345. OLESTATUS WINAPI OleRevertClientDoc(LHCLIENTDOC);
  346. OLESTATUS WINAPI OleSavedClientDoc(LHCLIENTDOC);
  347. OLESTATUS WINAPI OleEnumObjects(LHCLIENTDOC, LPOLEOBJECT FAR*);
  348. /* server usage definitions */
  349. typedef enum {
  350. OLE_SERVER_MULTI, /* multiple instances */
  351. OLE_SERVER_SINGLE /* single instance(multiple document) */
  352. } OLE_SERVER_USE;
  353. /* Server API */
  354. typedef struct _OLESERVER FAR* LPOLESERVER;
  355. OLESTATUS WINAPI OleRegisterServer(LPCSTR, LPOLESERVER, LHSERVER FAR*, HINSTANCE, OLE_SERVER_USE);
  356. OLESTATUS WINAPI OleRevokeServer(LHSERVER);
  357. OLESTATUS WINAPI OleBlockServer(LHSERVER);
  358. OLESTATUS WINAPI OleUnblockServer(LHSERVER, BOOL FAR*);
  359. /* APIs to keep server open */
  360. OLESTATUS WINAPI OleLockServer(LPOLEOBJECT, LHSERVER FAR*);
  361. OLESTATUS WINAPI OleUnlockServer(LHSERVER);
  362. /* Server document API */
  363. typedef struct _OLESERVERDOC FAR* LPOLESERVERDOC;
  364. OLESTATUS WINAPI OleRegisterServerDoc(LHSERVER, LPCSTR, LPOLESERVERDOC, LHSERVERDOC FAR*);
  365. OLESTATUS WINAPI OleRevokeServerDoc(LHSERVERDOC);
  366. OLESTATUS WINAPI OleRenameServerDoc(LHSERVERDOC, LPCSTR);
  367. OLESTATUS WINAPI OleRevertServerDoc(LHSERVERDOC);
  368. OLESTATUS WINAPI OleSavedServerDoc(LHSERVERDOC);
  369. typedef struct _OLESERVERVTBL
  370. {
  371. OLESTATUS (CALLBACK* Open) (LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, LPOLESERVERDOC FAR*);
  372. /* long handle to doc(privtate to DLL) */
  373. /* lp to OLESERVER */
  374. /* document name */
  375. /* place holder for returning oledoc. */
  376. OLESTATUS (CALLBACK* Create)(LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, OLE_LPCSTR, LPOLESERVERDOC FAR*);
  377. /* long handle to doc(privtate to DLL) */
  378. /* lp to OLESERVER */
  379. /* lp class name */
  380. /* lp doc name */
  381. /* place holder for returning oledoc. */
  382. OLESTATUS (CALLBACK* CreateFromTemplate)(LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, OLE_LPCSTR, OLE_LPCSTR, LPOLESERVERDOC FAR*);
  383. /* long handle to doc(privtate to DLL) */
  384. /* lp to OLESERVER */
  385. /* lp class name */
  386. /* lp doc name */
  387. /* lp template name */
  388. /* place holder for returning oledoc. */
  389. OLESTATUS (CALLBACK* Edit) (LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, OLE_LPCSTR, LPOLESERVERDOC FAR*);
  390. /* long handle to doc(privtate to DLL) */
  391. /* lp to OLESERVER */
  392. /* lp class name */
  393. /* lp doc name */
  394. /* place holder for returning oledoc. */
  395. OLESTATUS (CALLBACK* Exit) (LPOLESERVER);
  396. /* lp OLESERVER */
  397. OLESTATUS (CALLBACK* Release) (LPOLESERVER);
  398. /* lp OLESERVER */
  399. OLESTATUS (CALLBACK* Execute)(LPOLESERVER, HGLOBAL);
  400. /* lp OLESERVER */
  401. /* handle to command strings */
  402. } OLESERVERVTBL;
  403. typedef OLESERVERVTBL FAR* LPOLESERVERVTBL;
  404. typedef struct _OLESERVER
  405. {
  406. LPOLESERVERVTBL lpvtbl;
  407. } OLESERVER;
  408. typedef struct _OLESERVERDOCVTBL
  409. {
  410. OLESTATUS (CALLBACK* Save) (LPOLESERVERDOC);
  411. OLESTATUS (CALLBACK* Close) (LPOLESERVERDOC);
  412. OLESTATUS (CALLBACK* SetHostNames)(LPOLESERVERDOC, OLE_LPCSTR, OLE_LPCSTR);
  413. OLESTATUS (CALLBACK* SetDocDimensions)(LPOLESERVERDOC, OLE_CONST RECT FAR*);
  414. OLESTATUS (CALLBACK* GetObject) (LPOLESERVERDOC, OLE_LPCSTR, LPOLEOBJECT FAR*, LPOLECLIENT);
  415. OLESTATUS (CALLBACK* Release) (LPOLESERVERDOC);
  416. OLESTATUS (CALLBACK* SetColorScheme)(LPOLESERVERDOC, OLE_CONST LOGPALETTE FAR*);
  417. OLESTATUS (CALLBACK* Execute) (LPOLESERVERDOC, HGLOBAL);
  418. } OLESERVERDOCVTBL;
  419. typedef OLESERVERDOCVTBL FAR* LPOLESERVERDOCVTBL;
  420. typedef struct _OLESERVERDOC
  421. {
  422. LPOLESERVERDOCVTBL lpvtbl;
  423. } OLESERVERDOC;
  424. #ifdef __cplusplus
  425. }
  426. #endif /* __cplusplus */
  427. #ifndef RC_INVOKED
  428. #pragma pack()
  429. #endif /* !RC_INVOKED */
  430. #endif /* !_INC_OLE */
  431.