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.

567 lines
24 KiB

  1. /*---------------------------------------------------------------------------
  2. | MPOLE.H
  3. | This file is the header file that has most of the OLE2 specific
  4. | data structures.
  5. |
  6. | Created By: Vij Rajarajan (VijR)
  7. +---------------------------------------------------------------------------*/
  8. #ifndef COBJMACROS
  9. #define COBJMACROS
  10. #endif
  11. #ifdef MTN
  12. #pragma warning(disable: 4103) // used #pragma pack to change alignment (on Chicago)
  13. #endif
  14. #include <ole2.h>
  15. #include <ole2ver.h>
  16. #include <shlobj.h> /* For ResolveLink() */
  17. #include "server.h"
  18. #ifdef INCGUID
  19. #include <initguid.h>
  20. #endif
  21. #define _NOHRESULT
  22. #define INPLACE
  23. #define DRAGDROP
  24. #define RETURN_RESULT(sc) return(ResultFromScode(sc))
  25. // number HIMETRIC units per inch
  26. #define HIMETRIC_PER_INCH 2540
  27. #if (defined(DEBUG) || DBG)
  28. BOOL WriteOLE2Class( );
  29. #endif
  30. /**** 'lindex' related macros ****/
  31. #define DEF_LINDEX -1
  32. #define VERIFY_LINDEX(lindex) { \
  33. if (lindex != -1) \
  34. return (ResultFromScode(E_INVALIDARG)); \
  35. }
  36. // Used to check for "-Embedding" on command line.
  37. #define szEmbeddingFlag "Embedding"
  38. // Maximum length of a fully-qualified pathname.
  39. #define cchFilenameMax 256
  40. //OLE2 CLsids
  41. DEFINE_OLEGUID(CLSID_MPlayer, 0x00022601, 0, 0);
  42. #define CLSID_MPLAYER CLSID_MPlayer
  43. //OLE1 clsid.
  44. DEFINE_OLEGUID(CLSID_Ole1MPlayer, 0x0003000E, 0, 0);
  45. #define CLSID_OLE1MPLAYER CLSID_Ole1MPlayer
  46. extern TCHAR gachProgID[];
  47. extern CLSID gClsID;
  48. extern CLSID gClsIDOLE1Compat; /* This will be MPlayer's OLE1 class ID */
  49. /* if we're servicing a Media Clip object, */
  50. /* otherwise it's the same as gClsID. */
  51. // Sizes of toolbar items
  52. #define TOOLBAR_WIDTH 300
  53. #define TOOL_WIDTH 26
  54. /* Types */
  55. // Document type
  56. typedef enum
  57. {
  58. doctypeNew, // The document is untitled.
  59. doctypeFromFile, // The document exists in a file and may be linked.
  60. doctypeEmbedded, // The document is an embedded document.
  61. } DOCTYPE;
  62. // Verbs
  63. typedef enum
  64. {
  65. verbPlay = OLEIVERB_PRIMARY,
  66. verbEdit,
  67. verbOpen,
  68. verbNil
  69. } VERB;
  70. // Corresponds to the order of the menus in the .rc file.
  71. enum {
  72. menuposFile,
  73. menuposEdit,
  74. menuposDevice,
  75. menuposScale,
  76. menuposHelp
  77. };
  78. #ifdef OLDSTUFF
  79. /* Codes for CallBack events */
  80. /* The first four of these are redefinitions on NT, and the others don't exist: */
  81. typedef enum {
  82. OLE_CHANGED, /* 0 */
  83. OLE_SAVED, /* 1 */
  84. OLE_CLOSED, /* 2 */
  85. OLE_RENAMED, /* 3 */
  86. OLE_SAVEOBJ, /* 4 */
  87. OLE_SIZECHG, /* 5 */
  88. OLE_SHOWOBJ /* 6 */
  89. } OLE_NOTIFICATION;
  90. #endif
  91. typedef enum
  92. {
  93. OLE_CHANGED, /* 0 */
  94. OLE_SAVED, /* 1 */
  95. OLE_CLOSED, /* 2 */
  96. OLE_RENAMED, /* 3 */
  97. OLE_QUERY_PAINT, /* 4 Interruptible paint support */
  98. OLE_RELEASE, /* 5 Object is released(asynchronous operation */
  99. /* is completed) */
  100. OLE_QUERY_RETRY /* 6 Query for retry when server sends busy ACK */
  101. } OLE_NOTIFICATION;
  102. #define OLE_SAVEOBJ 7
  103. #define OLE_SIZECHG 8
  104. #define OLE_SHOWOBJ 9
  105. // Server structure
  106. typedef struct
  107. {
  108. IClassFactory olesrvr; // This must be the first field so that
  109. BOOL fEmbedding; // was server launched for embedding
  110. int cRef; // ref count;
  111. int cLock; // Lock count
  112. DWORD dwRegCF;
  113. } SRVR, FAR *LPSRVR;
  114. //InPlace data structure.
  115. typedef struct tagINPLACEDATA {
  116. OLEMENUGROUPWIDTHS menuWidths;
  117. HOLEMENU holemenu;
  118. HMENU hmenuShared;
  119. LPOLEINPLACESITE lpSite;
  120. LPOLEINPLACEUIWINDOW lpUIWindow;
  121. LPOLEINPLACEFRAME lpFrame;
  122. OLEINPLACEFRAMEINFO frameInfo;
  123. BOOL fNoNotification;
  124. BOOL fInContextHelpMode;
  125. } INPLACEDATA, * PINPLACEDATA, FAR* LPINPLACEDATA;
  126. typedef struct DOC FAR* LPDOC;
  127. // Document structure
  128. typedef struct DOC
  129. {
  130. struct COleObjectImpl {
  131. IOleObjectVtbl FAR* lpVtbl;
  132. LPDOC lpdoc;
  133. } m_Ole;
  134. struct CDataObjectImpl {
  135. IDataObjectVtbl FAR* lpVtbl;
  136. LPDOC lpdoc;
  137. } m_Data;
  138. struct CPersistStorageImpl {
  139. IPersistStorageVtbl FAR* lpVtbl;
  140. LPDOC lpdoc;
  141. } m_PersistStorage;
  142. struct COleInPlaceObjectImpl {
  143. IOleInPlaceObjectVtbl FAR* lpVtbl;
  144. LPDOC lpdoc;
  145. } m_InPlace;
  146. struct COleInPlaceActiveObjectImpl {
  147. IOleInPlaceActiveObjectVtbl FAR* lpVtbl;
  148. LPDOC lpdoc;
  149. } m_IPActive;
  150. struct CPersistFileImpl {
  151. IPersistFileVtbl FAR* lpVtbl;
  152. LPDOC lpdoc;
  153. } m_PersistFile;
  154. int cRef; // ref count.
  155. HWND hwnd; // The object's own window
  156. LPTSTR native; // Object data in native format
  157. LPOLECLIENTSITE lpoleclient; // Client associated with the object
  158. LPDATAADVISEHOLDER lpdaholder; // util instance to hold data advises
  159. LPOLEADVISEHOLDER lpoaholder; // util instance to hold ole advises
  160. DOCTYPE doctype; // Document type
  161. ATOM aDocName; // Document name
  162. HWND hwndParent;
  163. LPINPLACEDATA lpIpData;
  164. int cLock;
  165. } DOC;
  166. typedef struct ClipDragData CLIPDRAGDATA, FAR* LPCLIPDRAGDATA;
  167. typedef struct ClipDragEnum CLIPDRAGENUM, FAR* LPCLIPDRAGENUM;
  168. struct ClipDragData
  169. {
  170. struct CDataObject {
  171. IDataObjectVtbl FAR* lpVtbl;
  172. LPCLIPDRAGDATA lpclipdragdata;
  173. } m_IDataObject;
  174. struct CDropSource {
  175. IDropSourceVtbl FAR* lpVtbl;
  176. LPCLIPDRAGDATA lpclipdragdata;
  177. } m_IDropSource;
  178. LPDOC lpdoc;
  179. int cRef; // ref count
  180. LPCLIPDRAGENUM lpClipDragEnum; // The enumerator
  181. BOOL fClipData; //Is this for Clipboard or Dragdrop
  182. } ;
  183. struct ClipDragEnum
  184. {
  185. IEnumFORMATETCVtbl FAR* lpVtbl;
  186. int cRef; // ref count
  187. LPCLIPDRAGDATA lpClipDragData; // Obj to which enumerator blongs
  188. CLIPFORMAT cfNext; // Next format returned
  189. };
  190. #ifdef LATER
  191. typedef struct _SCALE
  192. {
  193. int num; // Numerator
  194. int denom; // Denominator
  195. }
  196. SCALE, *PSCALE;
  197. extern SCALE gscaleInitXY[2]; // Initial scale to use for inserting OLE objects
  198. #define SCALE_X 0
  199. #define SCALE_Y 1
  200. #endif
  201. /* Global variable declarations. (See SrvrDemo.c for descriptions.) */
  202. extern LPMALLOC lpMalloc;
  203. extern HMENU hmenuMain;
  204. extern SRVR srvrMain;
  205. extern DOC docMain;
  206. extern BOOL fDocChanged;
  207. extern TCHAR szClient[];
  208. extern TCHAR szClientDoc[];
  209. extern int extHeight;
  210. extern int extWidth;
  211. extern TCHAR dbs[];
  212. extern int giXppli, giYppli;
  213. extern BOOL SkipInPlaceEdit;
  214. extern BOOL gfInPlaceResize;
  215. extern BOOL gfOle1Client;
  216. extern HWND ghwndIPHatch;
  217. extern HANDLE ghClipData;
  218. extern HANDLE ghClipMetafile;
  219. extern HANDLE ghClipDib;
  220. extern LONG glCurrentVerb;
  221. extern BOOL gfPosRectChange;
  222. extern RECT gPrevPosRect;
  223. extern BOOL gfInPPViewer;
  224. extern HWND ghwndFrame;
  225. extern HWND ghwndFocusSave;
  226. extern CLIPFORMAT cfNative;
  227. extern CLIPFORMAT cfEmbedSource;
  228. extern CLIPFORMAT cfObjectDescriptor;
  229. extern CLIPFORMAT cfMPlayer;
  230. extern IOleObjectVtbl oleVtbl;
  231. extern IDataObjectVtbl dataVtbl;
  232. extern IEnumFORMATETCVtbl ClipDragEnumVtbl;
  233. extern IClassFactoryVtbl srvrVtbl;
  234. extern IPersistStorageVtbl persistStorageVtbl;
  235. extern IOleInPlaceObjectVtbl ipVtbl;
  236. extern IOleInPlaceActiveObjectVtbl ipActiveVtbl;
  237. extern IDataObjectVtbl clipdragVtbl;
  238. extern IDropSourceVtbl dropsourceVtbl;
  239. #ifdef LATER
  240. extern IDropTargetVtbl droptargetVtbl;
  241. #endif
  242. extern IPersistFileVtbl persistFileVtbl;
  243. /* Function Prototypes */
  244. // Various functions
  245. BOOL InitOLE (PBOOL pfInit, LPMALLOC *ppMalloc);
  246. BOOL CreateDocObjFromFile (LPCTSTR lpszDoc, LPDOC lpdoc);
  247. BOOL ReadObjFromFile(LPTSTR, LPDOC);
  248. BOOL InitNewDocObj (LPDOC lpdoc);
  249. void CutOrCopyObj (LPDOC lpobj);
  250. void DestroyDoc (LPDOC lpdoc);
  251. void DeviceToHiMetric (LPSIZEL lpsizel);
  252. void UpdateObject (void);
  253. BOOL InitServer (HWND hwnd, HANDLE hInst);
  254. void DestroyServer (LPSRVR lpsrvr);
  255. BOOL OpenDoc (UINT wid, LPTSTR lpsz);
  256. BOOL NewDoc (void);
  257. SCODE SendDocMsg (LPDOC lpdoc, WORD wMessage);
  258. BOOL SetTitle (LPDOC lpdoc, LPCTSTR lpszDoc);
  259. BOOL ExitApplication ();
  260. LPCLIPDRAGDATA CreateClipDragDataObject ( LPDOC lpdoc, BOOL fClipData);
  261. void SubClassMCIWindow(void);
  262. void DoDrag(void);
  263. void CleanUpDrag(void);
  264. HANDLE GetLink (VOID);
  265. SCODE ItemSetData(LPBYTE);
  266. STDMETHODIMP DoInPlaceEdit(LPDOC lpdoc, LPMSG lpmsg, LPOLECLIENTSITE pActiveSite, LONG verb, HWND FAR * lphwnd, LPRECT lprect);
  267. void DoInPlaceDeactivate (LPDOC lpdoc);
  268. STDMETHODIMP AssembleMenus (LPDOC lpdoc, BOOL fPlayOnly);
  269. STDMETHODIMP DisassembleMenus (LPDOC lpdoc);
  270. LPTSTR Abbrev (LPTSTR lpsz);
  271. // Server methods
  272. STDMETHODIMP SrvrQueryInterface (LPCLASSFACTORY, REFIID, LPVOID FAR *);
  273. STDMETHODIMP_(ULONG) SrvrAddRef (LPCLASSFACTORY);
  274. STDMETHODIMP_(ULONG) SrvrRelease (LPCLASSFACTORY);
  275. STDMETHODIMP SrvrCreateInstance (LPCLASSFACTORY, LPUNKNOWN, REFIID, LPVOID FAR *);
  276. STDMETHODIMP SrvrLockServer (LPCLASSFACTORY, BOOL);
  277. STDMETHODIMP UnkQueryInterface (LPUNKNOWN, REFIID, LPVOID FAR *);
  278. STDMETHODIMP_(ULONG) UnkAddRef (LPUNKNOWN);
  279. STDMETHODIMP_(ULONG) UnkRelease (LPUNKNOWN);
  280. STDMETHODIMP OleObjQueryInterface (LPOLEOBJECT, REFIID, LPVOID FAR *);
  281. STDMETHODIMP_(ULONG) OleObjAddRef (LPOLEOBJECT);
  282. STDMETHODIMP_(ULONG) OleObjRelease (LPOLEOBJECT);
  283. STDMETHODIMP OleObjSetClientSite (LPOLEOBJECT, LPOLECLIENTSITE);
  284. STDMETHODIMP OleObjGetClientSite (LPOLEOBJECT, LPOLECLIENTSITE FAR*);
  285. STDMETHODIMP OleObjSetHostNames (LPOLEOBJECT, LPCWSTR, LPCWSTR);
  286. STDMETHODIMP OleObjClose (LPOLEOBJECT, DWORD);
  287. STDMETHODIMP OleObjSetMoniker (LPOLEOBJECT, DWORD, LPMONIKER);
  288. STDMETHODIMP OleObjGetMoniker (LPOLEOBJECT, DWORD, DWORD, LPMONIKER FAR*);
  289. STDMETHODIMP OleObjInitFromData (LPOLEOBJECT, LPDATAOBJECT, BOOL, DWORD);
  290. STDMETHODIMP OleObjGetClipboardData (LPOLEOBJECT, DWORD, LPDATAOBJECT FAR*);
  291. STDMETHODIMP OleObjDoVerb (LPOLEOBJECT, LONG, LPMSG, LPOLECLIENTSITE, LONG, HWND, LPCRECT);
  292. STDMETHODIMP OleObjEnumVerbs(LPOLEOBJECT, IEnumOLEVERB FAR* FAR*);
  293. STDMETHODIMP OleObjUpdate(LPOLEOBJECT);
  294. STDMETHODIMP OleObjIsUpToDate(LPOLEOBJECT);
  295. STDMETHODIMP OleObjGetUserClassID (LPOLEOBJECT, CLSID FAR* pClsid);
  296. STDMETHODIMP OleObjGetUserType (LPOLEOBJECT, DWORD, LPWSTR FAR*);
  297. STDMETHODIMP OleObjSetExtent(LPOLEOBJECT, DWORD, LPSIZEL);
  298. STDMETHODIMP OleObjGetExtent(LPOLEOBJECT, DWORD, LPSIZEL);
  299. STDMETHODIMP OleObjAdvise(LPOLEOBJECT, LPADVISESINK, LPDWORD);
  300. STDMETHODIMP OleObjUnadvise(LPOLEOBJECT, DWORD);
  301. STDMETHODIMP OleObjEnumAdvise (LPOLEOBJECT, LPENUMSTATDATA FAR*);
  302. STDMETHODIMP OleObjGetMiscStatus (LPOLEOBJECT, DWORD, DWORD FAR*);
  303. STDMETHODIMP OleObjSetColorScheme (LPOLEOBJECT, LPLOGPALETTE);
  304. STDMETHODIMP DataObjQueryInterface (LPDATAOBJECT, REFIID, LPVOID FAR *);
  305. STDMETHODIMP_(ULONG) DataObjAddRef (LPDATAOBJECT);
  306. STDMETHODIMP_(ULONG) DataObjRelease (LPDATAOBJECT);
  307. STDMETHODIMP DataObjGetData (LPDATAOBJECT, LPFORMATETC, LPSTGMEDIUM);
  308. STDMETHODIMP DataObjGetDataHere (LPDATAOBJECT, LPFORMATETC, LPSTGMEDIUM);
  309. STDMETHODIMP DataObjQueryGetData (LPDATAOBJECT, LPFORMATETC);
  310. STDMETHODIMP DataObjGetCanonicalFormatEtc (LPDATAOBJECT, LPFORMATETC,
  311. LPFORMATETC);
  312. STDMETHODIMP DataObjSetData (LPDATAOBJECT, LPFORMATETC, LPSTGMEDIUM, BOOL);
  313. STDMETHODIMP DataObjEnumFormatEtc (LPDATAOBJECT, DWORD, LPENUMFORMATETC FAR*);
  314. STDMETHODIMP DataObjAdvise(LPDATAOBJECT, FORMATETC FAR*,
  315. DWORD, IAdviseSink FAR*, DWORD FAR*);
  316. STDMETHODIMP DataObjUnadvise(LPDATAOBJECT, DWORD );
  317. STDMETHODIMP DataObjEnumAdvise(LPDATAOBJECT, LPENUMSTATDATA FAR*);
  318. STDMETHODIMP ClipDragEnumQueryInterface (LPENUMFORMATETC, REFIID, LPVOID FAR *);
  319. STDMETHODIMP_(ULONG) ClipDragEnumAddRef (LPENUMFORMATETC);
  320. STDMETHODIMP_(ULONG) ClipDragEnumRelease (LPENUMFORMATETC);
  321. STDMETHODIMP ClipDragEnumNext (LPENUMFORMATETC, ULONG, FORMATETC FAR[],
  322. ULONG FAR*);
  323. STDMETHODIMP ClipDragEnumSkip (LPENUMFORMATETC, ULONG);
  324. STDMETHODIMP ClipDragEnumReset (LPENUMFORMATETC);
  325. STDMETHODIMP ClipDragEnumClone (LPENUMFORMATETC, LPENUMFORMATETC FAR*);
  326. STDMETHODIMP ClipDragUnknownQueryInterface (LPCLIPDRAGDATA, REFIID, LPVOID FAR *);
  327. STDMETHODIMP_(ULONG) ClipDragUnknownAddRef (LPCLIPDRAGDATA);
  328. STDMETHODIMP_(ULONG) ClipDragUnknownRelease (LPCLIPDRAGDATA);
  329. STDMETHODIMP ClipDragQueryInterface (LPDATAOBJECT, REFIID, LPVOID FAR *);
  330. STDMETHODIMP_(ULONG) ClipDragAddRef (LPDATAOBJECT);
  331. STDMETHODIMP_(ULONG) ClipDragRelease (LPDATAOBJECT);
  332. STDMETHODIMP ClipDragGetData (LPDATAOBJECT, LPFORMATETC, LPSTGMEDIUM);
  333. STDMETHODIMP ClipDragGetDataHere (LPDATAOBJECT, LPFORMATETC, LPSTGMEDIUM);
  334. STDMETHODIMP ClipDragQueryGetData (LPDATAOBJECT, LPFORMATETC);
  335. STDMETHODIMP ClipDragGetCanonicalFormatEtc (LPDATAOBJECT,
  336. LPFORMATETC, LPFORMATETC);
  337. STDMETHODIMP ClipDragSetData (LPDATAOBJECT,
  338. LPFORMATETC, LPSTGMEDIUM, BOOL);
  339. STDMETHODIMP ClipDragEnumFormatEtc (LPDATAOBJECT,
  340. DWORD, LPENUMFORMATETC FAR*);
  341. STDMETHODIMP ClipDragAdvise(LPDATAOBJECT, FORMATETC FAR*,
  342. DWORD, IAdviseSink FAR*, DWORD FAR*);
  343. STDMETHODIMP ClipDragUnadvise(LPDATAOBJECT, DWORD );
  344. STDMETHODIMP ClipDragEnumAdvise(LPDATAOBJECT, LPENUMSTATDATA FAR*);
  345. STDMETHODIMP DropSourceQueryInterface (LPDROPSOURCE, REFIID, LPVOID FAR *);
  346. STDMETHODIMP_(ULONG) DropSourceAddRef (LPDROPSOURCE);
  347. STDMETHODIMP_(ULONG) DropSourceRelease (LPDROPSOURCE);
  348. STDMETHODIMP DropSourceQueryContinueDrag (LPDROPSOURCE, BOOL, DWORD );
  349. STDMETHODIMP DropSourceGiveFeedback (LPDROPSOURCE, DWORD );
  350. STDMETHODIMP PSQueryInterface (LPPERSISTSTORAGE, REFIID, LPVOID FAR *);
  351. STDMETHODIMP_(ULONG) PSAddRef (LPPERSISTSTORAGE);
  352. STDMETHODIMP_(ULONG) PSRelease (LPPERSISTSTORAGE);
  353. STDMETHODIMP PSGetClassID(LPPERSISTSTORAGE, CLSID FAR*);
  354. STDMETHODIMP PSIsDirty(LPPERSISTSTORAGE);
  355. STDMETHODIMP PSInitNew (LPPERSISTSTORAGE, LPSTORAGE);
  356. STDMETHODIMP PSLoad (LPPERSISTSTORAGE, LPSTORAGE);
  357. STDMETHODIMP PSSave (LPPERSISTSTORAGE, LPSTORAGE, BOOL);
  358. STDMETHODIMP PSSaveCompleted(LPPERSISTSTORAGE, LPSTORAGE );
  359. STDMETHODIMP PSHandsOffStorage(LPPERSISTSTORAGE);
  360. STDMETHODIMP IPObjQueryInterface (LPOLEINPLACEOBJECT,REFIID, LPVOID FAR*);
  361. STDMETHODIMP_(ULONG) IPObjAddRef (LPOLEINPLACEOBJECT);
  362. STDMETHODIMP_(ULONG) IPObjRelease (LPOLEINPLACEOBJECT);
  363. STDMETHODIMP IPObjGetWindow (LPOLEINPLACEOBJECT, HWND FAR*);
  364. STDMETHODIMP IPObjContextSensitiveHelp (LPOLEINPLACEOBJECT, BOOL);
  365. STDMETHODIMP IPObjInPlaceDeactivate (LPOLEINPLACEOBJECT);
  366. STDMETHODIMP IPObjUIDeactivate (LPOLEINPLACEOBJECT);
  367. STDMETHODIMP IPObjSetObjectRects (LPOLEINPLACEOBJECT, LPCRECT, LPCRECT);
  368. STDMETHODIMP IPObjReactivateAndUndo (LPOLEINPLACEOBJECT);
  369. STDMETHODIMP IPActiveQueryInterface (LPOLEINPLACEACTIVEOBJECT,REFIID, LPVOID FAR*);
  370. STDMETHODIMP_(ULONG) IPActiveAddRef (LPOLEINPLACEACTIVEOBJECT);
  371. STDMETHODIMP_(ULONG) IPActiveRelease (LPOLEINPLACEACTIVEOBJECT);
  372. STDMETHODIMP IPActiveGetWindow (LPOLEINPLACEACTIVEOBJECT, HWND FAR*);
  373. STDMETHODIMP IPActiveContextSensitiveHelp (LPOLEINPLACEACTIVEOBJECT, BOOL);
  374. STDMETHODIMP IPActiveTranslateAccelerator (LPOLEINPLACEACTIVEOBJECT, LPMSG);
  375. STDMETHODIMP IPActiveOnFrameWindowActivate (LPOLEINPLACEACTIVEOBJECT, BOOL);
  376. STDMETHODIMP IPActiveOnDocWindowActivate (LPOLEINPLACEACTIVEOBJECT, BOOL);
  377. STDMETHODIMP IPActiveResizeBorder (LPOLEINPLACEACTIVEOBJECT, LPCRECT, LPOLEINPLACEUIWINDOW,BOOL);
  378. STDMETHODIMP IPActiveEnableModeless (LPOLEINPLACEACTIVEOBJECT, BOOL);
  379. STDMETHODIMP PFQueryInterface (LPPERSISTFILE, REFIID, LPVOID FAR *);
  380. STDMETHODIMP_(ULONG) PFAddRef (LPPERSISTFILE);
  381. STDMETHODIMP_(ULONG) PFRelease (LPPERSISTFILE);
  382. STDMETHODIMP PFGetClassID(LPPERSISTFILE, CLSID FAR*);
  383. STDMETHODIMP PFIsDirty(LPPERSISTFILE);
  384. STDMETHODIMP PFLoad (LPPERSISTFILE, LPCWSTR, DWORD);
  385. STDMETHODIMP PFSave (LPPERSISTFILE, LPCWSTR, BOOL);
  386. STDMETHODIMP PFSaveCompleted(LPPERSISTFILE, LPCWSTR );
  387. STDMETHODIMP PFGetCurFile(LPPERSISTFILE, LPWSTR FAR*);
  388. typedef enum
  389. {
  390. OLE1_OLEOK, /* 0 Function operated correctly */
  391. OLE1_OLEWAIT_FOR_RELEASE, /* 1 Command has been initiated, client */
  392. /* must wait for release. keep dispatching */
  393. /* messages till OLE1_OLERELESE in callback */
  394. OLE1_OLEBUSY, /* 2 Tried to execute a method while another */
  395. /* method is in progress. */
  396. OLE1_OLEERROR_PROTECT_ONLY, /* 3 Ole APIs are called in real mode */
  397. OLE1_OLEERROR_MEMORY, /* 4 Could not alloc or lock memory */
  398. OLE1_OLEERROR_STREAM, /* 5 (OLESTREAM) stream error */
  399. OLE1_OLEERROR_STATIC, /* 6 Non static object expected */
  400. OLE1_OLEERROR_BLANK, /* 7 Critical data missing */
  401. OLE1_OLEERROR_DRAW, /* 8 Error while drawing */
  402. OLE1_OLEERROR_METAFILE, /* 9 Invalid metafile */
  403. OLE1_OLEERROR_ABORT, /* 10 Client chose to abort metafile drawing */
  404. OLE1_OLEERROR_CLIPBOARD, /* 11 Failed to get/set clipboard data */
  405. OLE1_OLEERROR_FORMAT, /* 12 Requested format is not available */
  406. OLE1_OLEERROR_OBJECT, /* 13 Not a valid object */
  407. OLE1_OLEERROR_OPTION, /* 14 Invalid option(link update / render) */
  408. OLE1_OLEERROR_PROTOCOL, /* 15 Invalid protocol */
  409. OLE1_OLEERROR_ADDRESS, /* 16 One of the pointers is invalid */
  410. OLE1_OLEERROR_NOT_EQUAL, /* 17 Objects are not equal */
  411. OLE1_OLEERROR_HANDLE, /* 18 Invalid handle encountered */
  412. OLE1_OLEERROR_GENERIC, /* 19 Some general error */
  413. OLE1_OLEERROR_CLASS, /* 20 Invalid class */
  414. OLE1_OLEERROR_SYNTAX, /* 21 Command syntax is invalid */
  415. OLE1_OLEERROR_DATATYPE, /* 22 Data format is not supported */
  416. OLE1_OLEERROR_PALETTE, /* 23 Invalid color palette */
  417. OLE1_OLEERROR_NOT_LINK, /* 24 Not a linked object */
  418. OLE1_OLEERROR_NOT_EMPTY, /* 25 Client doc contains objects. */
  419. OLE1_OLEERROR_SIZE, /* 26 Incorrect buffer size passed to the api */
  420. /* that places some string in caller's */
  421. /* buffer */
  422. OLE1_OLEERROR_DRIVE, /* 27 Drive letter in doc name is invalid */
  423. OLE1_OLEERROR_NETWORK, /* 28 Failed to establish connection to a */
  424. /* network share on which the document */
  425. /* is located */
  426. OLE1_OLEERROR_NAME, /* 29 Invalid name(doc name, object name), */
  427. /* etc.. passed to the APIs */
  428. OLE1_OLEERROR_TEMPLATE, /* 30 Server failed to load template */
  429. OLE1_OLEERROR_NEW, /* 31 Server failed to create new doc */
  430. OLE1_OLEERROR_EDIT, /* 32 Server failed to create embedded */
  431. /* instance */
  432. OLE1_OLEERROR_OPEN, /* 33 Server failed to open document, */
  433. /* possible invalid link */
  434. OLE1_OLEERROR_NOT_OPEN, /* 34 Object is not open for editing */
  435. OLE1_OLEERROR_LAUNCH, /* 35 Failed to launch server */
  436. OLE1_OLEERROR_COMM, /* 36 Failed to communicate with server */
  437. OLE1_OLEERROR_TERMINATE, /* 37 Error in termination */
  438. OLE1_OLEERROR_COMMAND, /* 38 Error in execute */
  439. OLE1_OLEERROR_SHOW, /* 39 Error in show */
  440. OLE1_OLEERROR_DOVERB, /* 40 Error in sending do verb, or invalid */
  441. /* verb */
  442. OLE1_OLEERROR_ADVISE_NATIVE, /* 41 Item could be missing */
  443. OLE1_OLEERROR_ADVISE_PICT, /* 42 Item could be missing or server doesn't */
  444. /* this format. */
  445. OLE1_OLEERROR_ADVISE_RENAME, /* 43 Server doesn't support rename */
  446. OLE1_OLEERROR_POKE_NATIVE, /* 44 Failure of poking native data to server */
  447. OLE1_OLEERROR_REQUEST_NATIVE, /* 45 Server failed to render native data */
  448. OLE1_OLEERROR_REQUEST_PICT, /* 46 Server failed to render presentation */
  449. /* data */
  450. OLE1_OLEERROR_SERVER_BLOCKED, /* 47 Trying to block a blocked server or */
  451. /* trying to revoke a blocked server */
  452. /* or document */
  453. OLE1_OLEERROR_REGISTRATION, /* 48 Server is not registered in regestation */
  454. /* data base */
  455. OLE1_OLEERROR_ALREADY_REGISTERED,/*49 Trying to register same doc multiple */
  456. /* times */
  457. OLE1_OLEERROR_TASK, /* 50 Server or client task is invalid */
  458. OLE1_OLEERROR_OUTOFDATE, /* 51 Object is out of date */
  459. OLE1_OLEERROR_CANT_UPDATE_CLIENT,/* 52 Embed doc's client doesn't accept */
  460. /* updates */
  461. OLE1_OLEERROR_UPDATE, /* 53 erorr while trying to update */
  462. OLE1_OLEERROR_SETDATA_FORMAT, /* 54 Server app doesn't understand the */
  463. /* format given to its SetData method */
  464. OLE1_OLEERROR_STATIC_FROM_OTHER_OS,/* 55 trying to load a static object created */
  465. /* on another Operating System */
  466. /* Following are warnings */
  467. OLE1_OLEWARN_DELETE_DATA = 1000 /* Caller must delete the data when he is */
  468. /* done with it. */
  469. } OLE1_OLESTATUS;
  470. typedef OLE1_OLESTATUS (FAR PASCAL *OQOPROC)( LPVOID lpobj
  471. , HWND FAR* lphwnd
  472. , LPRECT lprc
  473. , LPRECT lprcWBounds
  474. );
  475. OLE1_OLESTATUS (FAR PASCAL *OleQueryObjPos)(LPVOID lpobj, HWND FAR* lphwnd, LPRECT lprc, LPRECT lprcWBounds);
  476. extern HMODULE hMciOle;