home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 November / PCWorld_2000-11_cd.bin / Software / Topware / devc40 / _SETUP.5 / Group3 / ole.h < prev    next >
C/C++ Source or Header  |  1999-11-07  |  12KB  |  305 lines

  1. #ifndef _OLE_H
  2. #define _OLE_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #ifdef STRICT
  7. #define OLE_LPCSTR LPCSTR
  8. #define OLE_CONST const
  9. #else
  10. #define OLE_LPCSTR LPSTR
  11. #define OLE_CONST
  12. #endif
  13. #define LRESULT LONG
  14. #define HGLOBAL HANDLE
  15. #define OT_LINK 1L
  16. #define OT_EMBEDDED 2L
  17. #define OT_STATIC 3L
  18. #define OLEVERB_PRIMARY 0
  19. #define OF_SET 1
  20. #define OF_GET 2
  21. #define OF_HANDLER 4
  22.  
  23. typedef struct _OLETARGETDEVICE {
  24.     USHORT otdDeviceNameOffset;
  25.     USHORT otdDriverNameOffset;
  26.     USHORT otdPortNameOffset;
  27.     USHORT otdExtDevmodeOffset;
  28.     USHORT otdExtDevmodeSize;
  29.     USHORT otdEnvironmentOffset;
  30.     USHORT otdEnvironmentSize;
  31.     BYTE otdData[1];
  32. } OLETARGETDEVICE;
  33. typedef OLETARGETDEVICE *LPOLETARGETDEVICE;
  34. typedef enum {
  35. OLE_OK,
  36. OLE_WAIT_FOR_RELEASE,
  37. OLE_BUSY,
  38. OLE_ERROR_PROTECT_ONLY,
  39. OLE_ERROR_MEMORY,
  40. OLE_ERROR_STREAM,
  41. OLE_ERROR_STATIC,
  42. OLE_ERROR_BLANK,
  43. OLE_ERROR_DRAW,
  44. OLE_ERROR_METAFILE,
  45. OLE_ERROR_ABORT,
  46. OLE_ERROR_CLIPBOARD,
  47. OLE_ERROR_FORMAT,
  48. OLE_ERROR_OBJECT,
  49. OLE_ERROR_OPTION,
  50. OLE_ERROR_PROTOCOL,
  51. OLE_ERROR_ADDRESS,
  52. OLE_ERROR_NOT_EQUAL,
  53. OLE_ERROR_HANDLE,
  54. OLE_ERROR_GENERIC,
  55. OLE_ERROR_CLASS,
  56. OLE_ERROR_SYNTAX,
  57. OLE_ERROR_DATATYPE,
  58. OLE_ERROR_PALETTE,
  59. OLE_ERROR_NOT_LINK,
  60. OLE_ERROR_NOT_EMPTY,
  61. OLE_ERROR_SIZE,
  62. OLE_ERROR_DRIVE,
  63. OLE_ERROR_NETWORK,
  64. OLE_ERROR_NAME,
  65. OLE_ERROR_TEMPLATE,
  66. OLE_ERROR_NEW,
  67. OLE_ERROR_EDIT,
  68. OLE_ERROR_OPEN,
  69. OLE_ERROR_NOT_OPEN,
  70. OLE_ERROR_LAUNCH,
  71. OLE_ERROR_COMM,
  72. OLE_ERROR_TERMINATE,
  73. OLE_ERROR_COMMAND,
  74. OLE_ERROR_SHOW,
  75. OLE_ERROR_DOVERB,
  76. OLE_ERROR_ADVISE_NATIVE,
  77. OLE_ERROR_ADVISE_PICT,
  78. OLE_ERROR_ADVISE_RENAME,
  79. OLE_ERROR_POKE_NATIVE,
  80. OLE_ERROR_REQUEST_NATIVE,
  81. OLE_ERROR_REQUEST_PICT,
  82. OLE_ERROR_SERVER_BLOCKED,
  83. OLE_ERROR_REGISTRATION,
  84. OLE_ERROR_ALREADY_REGISTERED,
  85. OLE_ERROR_TASK,
  86. OLE_ERROR_OUTOFDATE,
  87. OLE_ERROR_CANT_UPDATE_CLIENT,
  88. OLE_ERROR_UPDATE,
  89. OLE_ERROR_SETDATA_FORMAT,
  90. OLE_ERROR_STATIC_FROM_OTHER_OS,
  91. OLE_ERROR_FILE_VER,
  92. OLE_WARN_DELETE_DATA = 1000
  93. } OLESTATUS;
  94. typedef enum {
  95.     OLE_CHANGED,
  96.     OLE_SAVED,
  97.     OLE_CLOSED,
  98.     OLE_RENAMED,
  99.     OLE_QUERY_PAINT,
  100.     OLE_RELEASE,
  101.     OLE_QUERY_RETRY
  102. } OLE_NOTIFICATION;
  103. typedef enum {
  104.     OLE_NONE,
  105.     OLE_DELETE,
  106.     OLE_LNKPASTE,
  107.     OLE_EMBPASTE,
  108.     OLE_SHOW,
  109.     OLE_RUN,
  110.     OLE_ACTIVATE,
  111.     OLE_UPDATE,
  112.     OLE_CLOSE,
  113.     OLE_RECONNECT,
  114.     OLE_SETUPDATEOPTIONS,
  115.     OLE_SERVERUNLAUNCH,
  116.     OLE_LOADFROMSTREAM,
  117.     OLE_SETDATA,
  118.     OLE_REQUESTDATA,
  119.     OLE_OTHER,
  120.     OLE_CREATE,
  121.     OLE_CREATEFROMTEMPLATE,
  122.     OLE_CREATELINKFROMFILE,
  123.     OLE_COPYFROMLNK,
  124.     OLE_CREATEFROMFILE,
  125.     OLE_CREATEINVISIBLE
  126. } OLE_RELEASE_METHOD;
  127. typedef enum {
  128.     olerender_none,
  129.     olerender_draw,
  130.     olerender_format
  131.     } OLEOPT_RENDER;
  132. typedef WORD OLECLIPFORMAT;
  133. typedef enum {
  134.     oleupdate_always,
  135.     oleupdate_onsave,
  136. #ifdef OLE_INTERNAL
  137.     oleupdate_oncall,
  138.     oleupdate_onclose
  139. #else
  140.     oleupdate_oncall
  141. #endif
  142. } OLEOPT_UPDATE;
  143. typedef HANDLE HOBJECT;
  144. typedef LONG LHSERVER;
  145. typedef LONG LHCLIENTDOC;
  146. typedef LONG LHSERVERDOC;
  147. typedef struct _OLEOBJECT *LPOLEOBJECT;
  148. typedef struct _OLESTREAM *LPOLESTREAM;
  149. typedef struct _OLECLIENT *LPOLECLIENT;
  150. typedef struct _OLEOBJECTVTBL {
  151.     void *(CALLBACK* QueryProtocol)(LPOLEOBJECT,OLE_LPCSTR);
  152.     OLESTATUS (CALLBACK* Release)(LPOLEOBJECT);
  153.     OLESTATUS (CALLBACK* Show)(LPOLEOBJECT,BOOL);
  154.     OLESTATUS (CALLBACK* DoVerb)(LPOLEOBJECT,UINT,BOOL,BOOL);
  155.     OLESTATUS (CALLBACK* GetData)(LPOLEOBJECT,OLECLIPFORMAT,HANDLE*);
  156.     OLESTATUS (CALLBACK* SetData)(LPOLEOBJECT,OLECLIPFORMAT,HANDLE);
  157.     OLESTATUS (CALLBACK* SetTargetDevice)(LPOLEOBJECT,HGLOBAL);
  158.     OLESTATUS (CALLBACK* SetBounds)(LPOLEOBJECT,OLE_CONST RECT*);
  159.     OLECLIPFORMAT (CALLBACK* EnumFormats)(LPOLEOBJECT,OLECLIPFORMAT);
  160.     OLESTATUS (CALLBACK* SetColorScheme)(LPOLEOBJECT,OLE_CONST LOGPALETTE*);
  161. #ifndef SERVERONLY
  162.     OLESTATUS (CALLBACK* Delete)(LPOLEOBJECT);
  163.     OLESTATUS (CALLBACK* SetHostNames)(LPOLEOBJECT,OLE_LPCSTR,OLE_LPCSTR);
  164.     OLESTATUS (CALLBACK* SaveToStream)(LPOLEOBJECT,LPOLESTREAM);
  165.     OLESTATUS (CALLBACK* Clone)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,OLE_LPCSTR,LPOLEOBJECT*);
  166.     OLESTATUS (CALLBACK* CopyFromLink)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,OLE_LPCSTR,LPOLEOBJECT*);
  167.     OLESTATUS (CALLBACK* Equal)(LPOLEOBJECT,LPOLEOBJECT);
  168.     OLESTATUS (CALLBACK* CopyToClipboard)(LPOLEOBJECT);
  169.     OLESTATUS (CALLBACK* Draw)(LPOLEOBJECT,HDC,OLE_CONST RECT*,OLE_CONST RECT*,HDC);
  170.     OLESTATUS (CALLBACK* Activate)(LPOLEOBJECT,UINT,BOOL,BOOL,HWND,OLE_CONST RECT*);
  171.     OLESTATUS (CALLBACK* Execute)(LPOLEOBJECT,HGLOBAL,UINT);
  172.     OLESTATUS (CALLBACK* Close)(LPOLEOBJECT);
  173.     OLESTATUS (CALLBACK* Update)(LPOLEOBJECT);
  174.     OLESTATUS (CALLBACK* Reconnect)(LPOLEOBJECT);
  175.     OLESTATUS (CALLBACK* ObjectConvert)(LPOLEOBJECT,OLE_LPCSTR,LPOLECLIENT,LHCLIENTDOC,OLE_LPCSTR,LPOLEOBJECT*);
  176.     OLESTATUS (CALLBACK* GetLinkUpdateOptions)(LPOLEOBJECT,OLEOPT_UPDATE*);
  177.     OLESTATUS (CALLBACK* SetLinkUpdateOptions)(LPOLEOBJECT,OLEOPT_UPDATE);
  178.     OLESTATUS (CALLBACK* Rename)(LPOLEOBJECT,OLE_LPCSTR);
  179.     OLESTATUS (CALLBACK* QueryName)(LPOLEOBJECT,LPSTR,UINT*);
  180.     OLESTATUS (CALLBACK* QueryType)(LPOLEOBJECT,LONG*);
  181.     OLESTATUS (CALLBACK* QueryBounds)(LPOLEOBJECT,RECT*);
  182.     OLESTATUS (CALLBACK* QuerySize)(LPOLEOBJECT,DWORD*);
  183.     OLESTATUS (CALLBACK* QueryOpen)(LPOLEOBJECT);
  184.     OLESTATUS (CALLBACK* QueryOutOfDate)(LPOLEOBJECT);
  185.     OLESTATUS (CALLBACK* QueryReleaseStatus)(LPOLEOBJECT);
  186.     OLESTATUS (CALLBACK* QueryReleaseError)(LPOLEOBJECT);
  187.     OLE_RELEASE_METHOD (CALLBACK* QueryReleaseMethod)(LPOLEOBJECT);
  188.     OLESTATUS (CALLBACK* RequestData)(LPOLEOBJECT,OLECLIPFORMAT);
  189.     OLESTATUS (CALLBACK* ObjectLong)(LPOLEOBJECT,UINT,LONG*);
  190.     OLESTATUS (CALLBACK* ChangeData)(LPOLEOBJECT,HANDLE,LPOLECLIENT,BOOL);
  191. #endif
  192. } OLEOBJECTVTBL;
  193. typedef OLEOBJECTVTBL*LPOLEOBJECTVTBL;
  194. #ifndef OLE_INTERNAL
  195. typedef struct _OLEOBJECT { LPOLEOBJECTVTBL lpvtbl; } OLEOBJECT;
  196. #endif
  197. typedef struct _OLECLIENTVTBL { int (CALLBACK* CallBack)(LPOLECLIENT,OLE_NOTIFICATION,LPOLEOBJECT); } OLECLIENTVTBL;
  198. typedef OLECLIENTVTBL *LPOLECLIENTVTBL;
  199. typedef struct _OLECLIENT { LPOLECLIENTVTBL lpvtbl; } OLECLIENT;
  200. typedef struct _OLESTREAMVTBL {
  201.     DWORD (CALLBACK* Get)(LPOLESTREAM,void*,DWORD);
  202.     DWORD (CALLBACK* Put)(LPOLESTREAM,OLE_CONST void*,DWORD);
  203. } OLESTREAMVTBL;
  204. typedef OLESTREAMVTBL *LPOLESTREAMVTBL;
  205. typedef struct _OLESTREAM { LPOLESTREAMVTBL lpstbl; } OLESTREAM;
  206. typedef enum {
  207.     OLE_SERVER_MULTI,
  208.     OLE_SERVER_SINGLE
  209. } OLE_SERVER_USE;
  210. typedef struct _OLESERVER *LPOLESERVER;
  211. typedef struct _OLESERVERDOC *LPOLESERVERDOC;
  212. typedef struct _OLESERVERVTBL {
  213.     OLESTATUS (CALLBACK* Open)(LPOLESERVER,LHSERVERDOC,OLE_LPCSTR,LPOLESERVERDOC*);
  214.     OLESTATUS (CALLBACK* Create)(LPOLESERVER,LHSERVERDOC,OLE_LPCSTR,OLE_LPCSTR,LPOLESERVERDOC*);
  215.     OLESTATUS (CALLBACK* CreateFromTemplate)(LPOLESERVER,LHSERVERDOC,OLE_LPCSTR,OLE_LPCSTR,OLE_LPCSTR,LPOLESERVERDOC*);
  216.     OLESTATUS (CALLBACK* Edit)(LPOLESERVER,LHSERVERDOC,OLE_LPCSTR,OLE_LPCSTR,LPOLESERVERDOC*);
  217.     OLESTATUS (CALLBACK* Exit)(LPOLESERVER);
  218.     OLESTATUS (CALLBACK* Release)(LPOLESERVER);
  219.     OLESTATUS (CALLBACK* Execute)(LPOLESERVER,HGLOBAL);
  220. } OLESERVERVTBL;
  221. typedef OLESERVERVTBL *LPOLESERVERVTBL;
  222. typedef struct _OLESERVER { LPOLESERVERVTBL lpvtbl; } OLESERVER;
  223. typedef struct _OLESERVERDOCVTBL {
  224.     OLESTATUS (CALLBACK* Save)(LPOLESERVERDOC);
  225.     OLESTATUS (CALLBACK* Close)(LPOLESERVERDOC);
  226.     OLESTATUS (CALLBACK* SetHostNames)(LPOLESERVERDOC,OLE_LPCSTR,OLE_LPCSTR);
  227.     OLESTATUS (CALLBACK* SetDocDimensions)(LPOLESERVERDOC,OLE_CONST RECT*);
  228.     OLESTATUS (CALLBACK* GetObject)(LPOLESERVERDOC,OLE_LPCSTR,LPOLEOBJECT*,LPOLECLIENT);
  229.     OLESTATUS (CALLBACK* Release)(LPOLESERVERDOC);
  230.     OLESTATUS (CALLBACK* SetColorScheme)(LPOLESERVERDOC,OLE_CONST LOGPALETTE*);
  231.     OLESTATUS (CALLBACK* Execute)(LPOLESERVERDOC,HGLOBAL);
  232. } OLESERVERDOCVTBL;
  233. typedef OLESERVERDOCVTBL *LPOLESERVERDOCVTBL;
  234. typedef struct _OLESERVERDOC { LPOLESERVERDOCVTBL lpvtbl; } OLESERVERDOC;
  235. OLESTATUS WINAPI OleDelete(LPOLEOBJECT);
  236. OLESTATUS WINAPI OleRelease(LPOLEOBJECT);
  237. OLESTATUS WINAPI OleSaveToStream(LPOLEOBJECT,LPOLESTREAM);
  238. OLESTATUS WINAPI OleEqual(LPOLEOBJECT,LPOLEOBJECT );
  239. OLESTATUS WINAPI OleCopyToClipboard(LPOLEOBJECT);
  240. OLESTATUS WINAPI OleSetHostNames(LPOLEOBJECT,LPCSTR,LPCSTR);
  241. OLESTATUS WINAPI OleSetTargetDevice(LPOLEOBJECT,HGLOBAL);
  242. OLESTATUS WINAPI OleSetBounds(LPOLEOBJECT,LPCRECT);
  243. OLESTATUS WINAPI OleSetColorScheme(LPOLEOBJECT,const LOGPALETTE*);
  244. OLESTATUS WINAPI OleQueryBounds(LPOLEOBJECT,RECT*);
  245. OLESTATUS WINAPI OleQuerySize(LPOLEOBJECT,DWORD*);
  246. OLESTATUS WINAPI OleDraw(LPOLEOBJECT,HDC,LPCRECT,LPCRECT,HDC);
  247. OLESTATUS WINAPI OleQueryOpen(LPOLEOBJECT);
  248. OLESTATUS WINAPI OleActivate(LPOLEOBJECT,UINT,BOOL,BOOL,HWND,LPCRECT);
  249. OLESTATUS WINAPI OleExecute(LPOLEOBJECT,HGLOBAL,UINT);
  250. OLESTATUS WINAPI OleClose(LPOLEOBJECT);
  251. OLESTATUS WINAPI OleUpdate(LPOLEOBJECT);
  252. OLESTATUS WINAPI OleReconnect(LPOLEOBJECT);
  253. OLESTATUS WINAPI OleGetLinkUpdateOptions(LPOLEOBJECT,OLEOPT_UPDATE*);
  254. OLESTATUS WINAPI OleSetLinkUpdateOptions(LPOLEOBJECT,OLEOPT_UPDATE);
  255. void *WINAPI OleQueryProtocol(LPOLEOBJECT,LPCSTR);
  256. OLESTATUS WINAPI OleQueryReleaseStatus(LPOLEOBJECT);
  257. OLESTATUS WINAPI OleQueryReleaseError(LPOLEOBJECT);
  258. OLE_RELEASE_METHOD WINAPI OleQueryReleaseMethod(LPOLEOBJECT);
  259. OLESTATUS WINAPI OleQueryType(LPOLEOBJECT,LONG*);
  260. DWORD WINAPI OleQueryClientVersion(void);
  261. DWORD WINAPI OleQueryServerVersion(void);
  262. OLECLIPFORMAT WINAPI OleEnumFormats(LPOLEOBJECT,OLECLIPFORMAT);
  263. OLESTATUS WINAPI OleGetData(LPOLEOBJECT,OLECLIPFORMAT,HANDLE*);
  264. OLESTATUS WINAPI OleSetData(LPOLEOBJECT,OLECLIPFORMAT,HANDLE);
  265. OLESTATUS WINAPI OleQueryOutOfDate(LPOLEOBJECT);
  266. OLESTATUS WINAPI OleRequestData(LPOLEOBJECT,OLECLIPFORMAT);
  267. OLESTATUS WINAPI OleQueryLinkFromClip(LPCSTR,OLEOPT_RENDER,OLECLIPFORMAT);
  268. OLESTATUS WINAPI OleQueryCreateFromClip(LPCSTR,OLEOPT_RENDER,OLECLIPFORMAT);
  269. OLESTATUS WINAPI OleCreateFromClip(LPCSTR,LPOLECLIENT,LHCLIENTDOC,LPCSTR,LPOLEOBJECT*,OLEOPT_RENDER,OLECLIPFORMAT);
  270. OLESTATUS WINAPI OleCreateLinkFromClip(LPCSTR,LPOLECLIENT,LHCLIENTDOC,LPCSTR,LPOLEOBJECT*,OLEOPT_RENDER,OLECLIPFORMAT);
  271. OLESTATUS WINAPI OleCreateFromFile(LPCSTR,LPOLECLIENT,LPCSTR,LPCSTR,LHCLIENTDOC,LPCSTR,LPOLEOBJECT*,OLEOPT_RENDER,OLECLIPFORMAT);
  272. OLESTATUS WINAPI OleCreateLinkFromFile(LPCSTR,LPOLECLIENT,LPCSTR,LPCSTR,LPCSTR,LHCLIENTDOC,LPCSTR,LPOLEOBJECT*,OLEOPT_RENDER,OLECLIPFORMAT);
  273. OLESTATUS WINAPI OleLoadFromStream(LPOLESTREAM,LPCSTR,LPOLECLIENT,LHCLIENTDOC,LPCSTR,LPOLEOBJECT*);
  274. OLESTATUS WINAPI OleCreate(LPCSTR,LPOLECLIENT,LPCSTR,LHCLIENTDOC,LPCSTR,LPOLEOBJECT*,OLEOPT_RENDER,OLECLIPFORMAT);
  275. OLESTATUS WINAPI OleCreateInvisible(LPCSTR,LPOLECLIENT,LPCSTR,LHCLIENTDOC,LPCSTR,LPOLEOBJECT*,OLEOPT_RENDER,OLECLIPFORMAT,BOOL);
  276. OLESTATUS WINAPI OleCreateFromTemplate(LPCSTR,LPOLECLIENT,LPCSTR,LHCLIENTDOC,LPCSTR,LPOLEOBJECT*,OLEOPT_RENDER,OLECLIPFORMAT);
  277. OLESTATUS WINAPI OleClone(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,LPCSTR,LPOLEOBJECT*);
  278. OLESTATUS WINAPI OleCopyFromLink(LPOLEOBJECT,LPCSTR,LPOLECLIENT,LHCLIENTDOC,LPCSTR,LPOLEOBJECT*);
  279. OLESTATUS WINAPI OleObjectConvert(LPOLEOBJECT,LPCSTR,LPOLECLIENT,LHCLIENTDOC,LPCSTR,LPOLEOBJECT*);
  280. OLESTATUS WINAPI OleRename(LPOLEOBJECT,LPCSTR);
  281. OLESTATUS WINAPI OleQueryName(LPOLEOBJECT,LPSTR,UINT*);
  282. OLESTATUS WINAPI OleRevokeObject(LPOLECLIENT);
  283. BOOL WINAPI OleIsDcMeta(HDC);
  284. OLESTATUS WINAPI OleRegisterClientDoc(LPCSTR,LPCSTR,LONG,LHCLIENTDOC*);
  285. OLESTATUS WINAPI OleRevokeClientDoc(LHCLIENTDOC);
  286. OLESTATUS WINAPI OleRenameClientDoc(LHCLIENTDOC,LPCSTR);
  287. OLESTATUS WINAPI OleRevertClientDoc(LHCLIENTDOC);
  288. OLESTATUS WINAPI OleSavedClientDoc(LHCLIENTDOC);
  289. OLESTATUS WINAPI OleEnumObjects(LHCLIENTDOC,LPOLEOBJECT*);
  290. OLESTATUS WINAPI OleRegisterServer(LPCSTR,LPOLESERVER,LHSERVER*,HINSTANCE,OLE_SERVER_USE);
  291. OLESTATUS WINAPI OleRevokeServer(LHSERVER);
  292. OLESTATUS WINAPI OleBlockServer(LHSERVER);
  293. OLESTATUS WINAPI OleUnblockServer(LHSERVER,BOOL*);
  294. OLESTATUS WINAPI OleLockServer(LPOLEOBJECT,LHSERVER*);
  295. OLESTATUS WINAPI OleUnlockServer(LHSERVER);
  296. OLESTATUS WINAPI OleRegisterServerDoc(LHSERVER,LPCSTR,LPOLESERVERDOC,LHSERVERDOC*);
  297. OLESTATUS WINAPI OleRevokeServerDoc(LHSERVERDOC);
  298. OLESTATUS WINAPI OleRenameServerDoc(LHSERVERDOC,LPCSTR);
  299. OLESTATUS WINAPI OleRevertServerDoc(LHSERVERDOC);
  300. OLESTATUS WINAPI OleSavedServerDoc(LHSERVERDOC);
  301. #ifdef __cplusplus
  302. }
  303. #endif
  304. #endif
  305.