home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / MSINC.PAK / OLECTL.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  39KB  |  1,190 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // olectl.h     OLE Custom Control interfaces
  4. //
  5. //              OLE Version 2.0
  6. //
  7. /////////////////////////////////////////////////////////////////////////////
  8.  
  9. /*
  10.  *      C/C++ Run Time Library - Version 6.5
  11.  *
  12.  *      Copyright (c) 1994 by Borland International
  13.  *      All Rights Reserved.
  14.  *
  15.  */
  16.  
  17. #ifndef _OLECTL_H_
  18. #define _OLECTL_H_
  19. #define __OLECTL_H
  20.  
  21. #ifndef __MKTYPLIB__
  22.  
  23. // Set packing to 8
  24. #ifdef _WIN32
  25. #ifndef RC_INVOKED
  26. #pragma pack(8)
  27. #endif // not RC_INVOKED
  28. #endif // _WIN32
  29.  
  30. #ifndef INITGUID
  31. #include <olectlid.h>
  32. #endif
  33.  
  34.  
  35. #if !defined(_WIN32) && !defined(WIN32)
  36.  
  37. /////////////////////////////////////////////////////////////////////////////
  38. // Typedefs for characters and strings in interfaces
  39.  
  40. typedef char OLECHAR;
  41. typedef OLECHAR FAR* LPOLESTR;
  42. typedef const OLECHAR FAR* LPCOLESTR;
  43.  
  44. #endif // not _WIN32 && not WIN32
  45.  
  46.  
  47. /////////////////////////////////////////////////////////////////////////////
  48. // Typedefs for TEXTMETRIC structures
  49.  
  50. #if defined(_WIN32) && !defined(OLE2ANSI)
  51. typedef TEXTMETRICW TEXTMETRICOLE;
  52. #else
  53. typedef TEXTMETRIC TEXTMETRICOLE;
  54. #endif
  55.  
  56. typedef TEXTMETRICOLE FAR* LPTEXTMETRICOLE;
  57.  
  58.  
  59. /////////////////////////////////////////////////////////////////////////////
  60. // Typedefs for interfaces
  61.  
  62. #ifdef __cplusplus
  63. interface IOleControl;
  64. interface IOleControlSite;
  65. interface ISimpleFrameSite;
  66. interface IPersistStreamInit;
  67. interface IPropertyNotifySink;
  68. interface IProvideClassInfo;
  69. interface IConnectionPointContainer;
  70. interface IEnumConnectionPoints;
  71. interface IConnectionPoint;
  72. interface IEnumConnections;
  73. interface IClassFactory2;
  74. interface ISpecifyPropertyPages;
  75. interface IPerPropertyBrowsing;
  76. interface IPropertyPageSite;
  77. interface IPropertyPage;
  78. interface IPropertyPage2;
  79. interface IFont;
  80. interface IFontDisp;
  81. interface IPicture;
  82. interface IPictureDisp;
  83. #else
  84. typedef interface IOleControl IOleControl;
  85. typedef interface IOleControlSite IOleControlSite;
  86. typedef interface ISimpleFrameSite ISimpleFrameSite;
  87. typedef interface IPersistStreamInit IPersistStreamInit;
  88. typedef interface IPropertyNotifySink IPropertyNotifySink;
  89. typedef interface IProvideClassInfo IProvideClassInfo;
  90. typedef interface IConnectionPointContainer IConnectionPointContainer;
  91. typedef interface IEnumConnectionPoints IEnumConnectionPoints;
  92. typedef interface IConnectionPoint IConnectionPoint;
  93. typedef interface IEnumConnections IEnumConnections;
  94. typedef interface IClassFactory2 IClassFactory2;
  95. typedef interface ISpecifyPropertyPages ISpecifyPropertyPages;
  96. typedef interface IPerPropertyBrowsing IPerPropertyBrowsing;
  97. typedef interface IPropertyPageSite IPropertyPageSite;
  98. typedef interface IPropertyPage IPropertyPage;
  99. typedef interface IPropertyPage2 IPropertyPage2;
  100. typedef interface IFont IFont;
  101. typedef interface IFontDisp IFontDisp;
  102. typedef interface IPicture IPicture;
  103. typedef interface IPictureDisp IPictureDisp;
  104. #endif
  105.  
  106. typedef IOleControl FAR* LPOLECONTROL;
  107. typedef IOleControlSite FAR* LPOLECONTROLSITE;
  108. typedef ISimpleFrameSite FAR* LPSIMPLEFRAMESITE;
  109. typedef IPersistStreamInit FAR* LPPERSISTSTREAMINIT;
  110. typedef interface IPropertyNotifySink FAR* LPPROPERTYNOTIFYSINK;
  111. typedef IProvideClassInfo FAR* LPPROVIDECLASSINFO;
  112. typedef IConnectionPointContainer FAR* LPCONNECTIONPOINTCONTAINER;
  113. typedef IEnumConnectionPoints FAR* LPENUMCONNECTIONPOINTS;
  114. typedef IConnectionPoint FAR* LPCONNECTIONPOINT;
  115. typedef IEnumConnections FAR* LPENUMCONNECTIONS;
  116. typedef IClassFactory2 FAR* LPCLASSFACTORY2;
  117. typedef ISpecifyPropertyPages FAR* LPSPECIFYPROPERTYPAGES;
  118. typedef IPerPropertyBrowsing FAR* LPPERPROPERTYBROWSING;
  119. typedef IPropertyPageSite FAR* LPPROPERTYPAGESITE;
  120. typedef IPropertyPage FAR* LPPROPERTYPAGE;
  121. typedef IPropertyPage2 FAR* LPPROPERTYPAGE2;
  122. typedef IFont FAR* LPFONT;
  123. typedef IFontDisp FAR* LPFONTDISP;
  124. typedef IPicture FAR* LPPICTURE;
  125. typedef IPictureDisp FAR* LPPICTUREDISP;
  126.  
  127.  
  128. /////////////////////////////////////////////////////////////////////////////
  129. // Typedefs for structs
  130.  
  131. typedef struct tagPOINTF FAR* LPPOINTF;
  132. typedef struct tagCONTROLINFO FAR* LPCONTROLINFO;
  133. typedef struct tagCONNECTDATA FAR* LPCONNECTDATA;
  134. typedef struct tagLICINFO FAR* LPLICINFO;
  135. typedef struct tagCAUUID FAR* LPCAUUID;
  136. typedef struct tagCALPOLESTR FAR* LPCALPOLESTR;
  137. typedef struct tagCADWORD FAR* LPCADWORD;
  138. typedef struct tagOCPFIPARAMS FAR* LPOCPFIPARAMS;
  139. typedef struct tagPROPPAGEINFO FAR* LPPROPPAGEINFO;
  140. typedef struct tagFONTDESC FAR* LPFONTDESC;
  141. typedef struct tagPICTDESC FAR* LPPICTDESC;
  142.  
  143.  
  144. /////////////////////////////////////////////////////////////////////////////
  145. // Typedefs for standard scalar types
  146.  
  147. typedef DWORD OLE_COLOR;
  148. typedef long OLE_XPOS_PIXELS;
  149. typedef long OLE_YPOS_PIXELS;
  150. typedef long OLE_XSIZE_PIXELS;
  151. typedef long OLE_YSIZE_PIXELS;
  152. typedef long OLE_XPOS_HIMETRIC;
  153. typedef long OLE_YPOS_HIMETRIC;
  154. typedef long OLE_XSIZE_HIMETRIC;
  155. typedef long OLE_YSIZE_HIMETRIC;
  156. typedef float OLE_XPOS_CONTAINER;
  157. typedef float OLE_YPOS_CONTAINER;
  158. typedef float OLE_XSIZE_CONTAINER;
  159. typedef float OLE_YSIZE_CONTAINER;
  160. typedef enum { triUnchecked = 0, triChecked = 1, triGray = 2 } OLE_TRISTATE;
  161. typedef BOOL OLE_OPTEXCLUSIVE;
  162. typedef BOOL OLE_CANCELBOOL;
  163. typedef BOOL OLE_ENABLEDEFAULTBOOL;
  164. typedef UINT OLE_HANDLE;
  165.  
  166.  
  167. /////////////////////////////////////////////////////////////////////////////
  168. // FACILITY_CONTROL status codes
  169.  
  170. #ifndef FACILITY_CONTROL
  171. #define FACILITY_CONTROL 0xa
  172. #endif
  173.  
  174. #define STD_CTL_SCODE(n) MAKE_SCODE(SEVERITY_ERROR, FACILITY_CONTROL, n)
  175. #define CTL_E_ILLEGALFUNCTIONCALL       STD_CTL_SCODE(5)
  176. #define CTL_E_OVERFLOW                  STD_CTL_SCODE(6)
  177. #define CTL_E_OUTOFMEMORY               STD_CTL_SCODE(7)
  178. #define CTL_E_DIVISIONBYZERO            STD_CTL_SCODE(11)
  179. #define CTL_E_OUTOFSTRINGSPACE          STD_CTL_SCODE(14)
  180. #define CTL_E_OUTOFSTACKSPACE           STD_CTL_SCODE(28)
  181. #define CTL_E_BADFILENAMEORNUMBER       STD_CTL_SCODE(52)
  182. #define CTL_E_FILENOTFOUND              STD_CTL_SCODE(53)
  183. #define CTL_E_BADFILEMODE               STD_CTL_SCODE(54)
  184. #define CTL_E_FILEALREADYOPEN           STD_CTL_SCODE(55)
  185. #define CTL_E_DEVICEIOERROR             STD_CTL_SCODE(57)
  186. #define CTL_E_FILEALREADYEXISTS         STD_CTL_SCODE(58)
  187. #define CTL_E_BADRECORDLENGTH           STD_CTL_SCODE(59)
  188. #define CTL_E_DISKFULL                  STD_CTL_SCODE(61)
  189. #define CTL_E_BADRECORDNUMBER           STD_CTL_SCODE(63)
  190. #define CTL_E_BADFILENAME               STD_CTL_SCODE(64)
  191. #define CTL_E_TOOMANYFILES              STD_CTL_SCODE(67)
  192. #define CTL_E_DEVICEUNAVAILABLE         STD_CTL_SCODE(68)
  193. #define CTL_E_PERMISSIONDENIED          STD_CTL_SCODE(70)
  194. #define CTL_E_DISKNOTREADY              STD_CTL_SCODE(71)
  195. #define CTL_E_PATHFILEACCESSERROR       STD_CTL_SCODE(75)
  196. #define CTL_E_PATHNOTFOUND              STD_CTL_SCODE(76)
  197. #define CTL_E_INVALIDPATTERNSTRING      STD_CTL_SCODE(93)
  198. #define CTL_E_INVALIDUSEOFNULL          STD_CTL_SCODE(94)
  199. #define CTL_E_INVALIDFILEFORMAT         STD_CTL_SCODE(321)
  200. #define CTL_E_INVALIDPROPERTYVALUE      STD_CTL_SCODE(380)
  201. #define CTL_E_INVALIDPROPERTYARRAYINDEX STD_CTL_SCODE(381)
  202. #define CTL_E_SETNOTSUPPORTEDATRUNTIME  STD_CTL_SCODE(382)
  203. #define CTL_E_SETNOTSUPPORTED           STD_CTL_SCODE(383)
  204. #define CTL_E_NEEDPROPERTYARRAYINDEX    STD_CTL_SCODE(385)
  205. #define CTL_E_SETNOTPERMITTED           STD_CTL_SCODE(387)
  206. #define CTL_E_GETNOTSUPPORTEDATRUNTIME  STD_CTL_SCODE(393)
  207. #define CTL_E_GETNOTSUPPORTED           STD_CTL_SCODE(394)
  208. #define CTL_E_PROPERTYNOTFOUND          STD_CTL_SCODE(422)
  209. #define CTL_E_INVALIDCLIPBOARDFORMAT    STD_CTL_SCODE(460)
  210. #define CTL_E_INVALIDPICTURE            STD_CTL_SCODE(481)
  211. #define CTL_E_PRINTERERROR              STD_CTL_SCODE(482)
  212. #define CTL_E_CANTSAVEFILETOTEMP        STD_CTL_SCODE(735)
  213. #define CTL_E_SEARCHTEXTNOTFOUND        STD_CTL_SCODE(744)
  214. #define CTL_E_REPLACEMENTSTOOLONG       STD_CTL_SCODE(746)
  215.  
  216. #define CUSTOM_CTL_SCODE(n) MAKE_SCODE(SEVERITY_ERROR, FACILITY_CONTROL, n)
  217. #define CTL_E_CUSTOM_FIRST              CUSTOM_CTL_SCODE(600)
  218.  
  219.  
  220. /////////////////////////////////////////////////////////////////////////////
  221. // IClassFactory2 status codes
  222.  
  223. #define CLASS_E_NOTLICENSED         (CLASSFACTORY_E_FIRST+2)
  224. // class is not licensed for use
  225.  
  226.  
  227. /////////////////////////////////////////////////////////////////////////////
  228. // IConnectionPoint status codes
  229.  
  230. #define CONNECT_E_FIRST    MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x0200)
  231. #define CONNECT_E_LAST     MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x020F)
  232. #define CONNECT_S_FIRST    MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x0200)
  233. #define CONNECT_S_LAST     MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x020F)
  234.  
  235. #define CONNECT_E_NOCONNECTION      (CONNECT_E_FIRST+0)
  236. // there is no connection for this connection id
  237.  
  238. #define CONNECT_E_ADVISELIMIT       (CONNECT_E_FIRST+1)
  239. // this implementation's limit for advisory connections has been reached
  240.  
  241. #define CONNECT_E_CANNOTCONNECT     (CONNECT_E_FIRST+2)
  242. // connection attempt failed
  243.  
  244. #define CONNECT_E_OVERRIDDEN        (CONNECT_E_FIRST+3)
  245. // must use a derived interface to connect
  246.  
  247.  
  248. /////////////////////////////////////////////////////////////////////////////
  249. // DllRegisterServer/DllUnregisterServer status codes
  250.  
  251. #define SELFREG_E_FIRST    MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x0200)
  252. #define SELFREG_E_LAST     MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x020F)
  253. #define SELFREG_S_FIRST    MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x0200)
  254. #define SELFREG_S_LAST     MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x020F)
  255.  
  256. #define SELFREG_E_TYPELIB           (SELFREG_E_FIRST+0)
  257. // failed to register/unregister type library
  258.  
  259. #define SELFREG_E_CLASS             (SELFREG_E_FIRST+1)
  260. // failed to register/unregister class
  261.  
  262.  
  263. /////////////////////////////////////////////////////////////////////////////
  264. // IPerPropertyBrowsing status codes
  265.  
  266. #define PERPROP_E_FIRST    MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x0200)
  267. #define PERPROP_E_LAST     MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x020F)
  268. #define PERPROP_S_FIRST    MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x0200)
  269. #define PERPROP_S_LAST     MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x020F)
  270.  
  271. #define PERPROP_E_NOPAGEAVAILABLE   (PERPROP_E_FIRST+0)
  272. // no page available for requested property
  273.  
  274.  
  275. /////////////////////////////////////////////////////////////////////////////
  276. // OLEMISC_ constants
  277.  
  278. #define OLEMISC_INVISIBLEATRUNTIME  0x00000400
  279. #define OLEMISC_ALWAYSRUN           0x00000800
  280. #define OLEMISC_ACTSLIKEBUTTON      0x00001000
  281. #define OLEMISC_ACTSLIKELABEL       0x00002000
  282. #define OLEMISC_NOUIACTIVATE        0x00004000
  283. #define OLEMISC_ALIGNABLE           0x00008000
  284. #define OLEMISC_SIMPLEFRAME         0x00010000
  285. #define OLEMISC_SETCLIENTSITEFIRST  0x00020000
  286. #define OLEMISC_IMEMODE                         0x00040000
  287.  
  288.  
  289. /////////////////////////////////////////////////////////////////////////////
  290. // OLEIVERB_ constants
  291.  
  292. #ifndef OLEIVERB_PROPERTIES
  293. #define OLEIVERB_PROPERTIES (-7L)
  294. #endif
  295.  
  296.  
  297. /////////////////////////////////////////////////////////////////////////////
  298. // Variant type (VT_) tags for property sets
  299.  
  300. #define VT_STREAMED_PROPSET 73  //       [P]  Stream contains a property set
  301. #define VT_STORED_PROPSET   74  //       [P]  Storage contains a property set
  302. #define VT_BLOB_PROPSET     75  //       [P]  Blob contains a property set
  303.  
  304.  
  305. /////////////////////////////////////////////////////////////////////////////
  306. // Variant type (VT_) tags that are just aliases for others
  307.  
  308. #define VT_COLOR            VT_I4
  309. #define VT_XPOS_PIXELS      VT_I4
  310. #define VT_YPOS_PIXELS      VT_I4
  311. #define VT_XSIZE_PIXELS     VT_I4
  312. #define VT_YSIZE_PIXELS     VT_I4
  313. #define VT_XPOS_HIMETRIC    VT_I4
  314. #define VT_YPOS_HIMETRIC    VT_I4
  315. #define VT_XSIZE_HIMETRIC   VT_I4
  316. #define VT_YSIZE_HIMETRIC   VT_I4
  317. #define VT_TRISTATE         VT_I2
  318. #define VT_OPTEXCLUSIVE     VT_BOOL
  319. #define VT_FONT             VT_DISPATCH
  320. #define VT_PICTURE          VT_DISPATCH
  321.  
  322. #ifdef _WIN32
  323. #define VT_HANDLE           VT_I4
  324. #else
  325. #define VT_HANDLE           VT_I2
  326. #endif
  327.  
  328.  
  329. /////////////////////////////////////////////////////////////////////////////
  330. // Reflected Window Message IDs
  331.  
  332. #define OCM__BASE           (WM_USER+0x1c00)
  333. #define OCM_COMMAND         (OCM__BASE + WM_COMMAND)
  334.  
  335. #ifdef _WIN32
  336. #define OCM_CTLCOLORBTN     (OCM__BASE + WM_CTLCOLORBTN)
  337. #define OCM_CTLCOLOREDIT    (OCM__BASE + WM_CTLCOLOREDIT)
  338. #define OCM_CTLCOLORDLG     (OCM__BASE + WM_CTLCOLORDLG)
  339. #define OCM_CTLCOLORLISTBOX (OCM__BASE + WM_CTLCOLORLISTBOX)
  340. #define OCM_CTLCOLORMSGBOX  (OCM__BASE + WM_CTLCOLORMSGBOX)
  341. #define OCM_CTLCOLORSCROLLBAR   (OCM__BASE + WM_CTLCOLORSCROLLBAR)
  342. #define OCM_CTLCOLORSTATIC  (OCM__BASE + WM_CTLCOLORSTATIC)
  343. #else
  344. #define OCM_CTLCOLOR        (OCM__BASE + WM_CTLCOLOR)
  345. #endif
  346.  
  347. #define OCM_DRAWITEM        (OCM__BASE + WM_DRAWITEM)
  348. #define OCM_MEASUREITEM     (OCM__BASE + WM_MEASUREITEM)
  349. #define OCM_DELETEITEM      (OCM__BASE + WM_DELETEITEM)
  350. #define OCM_VKEYTOITEM      (OCM__BASE + WM_VKEYTOITEM)
  351. #define OCM_CHARTOITEM      (OCM__BASE + WM_CHARTOITEM)
  352. #define OCM_COMPAREITEM     (OCM__BASE + WM_COMPAREITEM)
  353. #define OCM_HSCROLL         (OCM__BASE + WM_HSCROLL)
  354. #define OCM_VSCROLL         (OCM__BASE + WM_VSCROLL)
  355. #define OCM_PARENTNOTIFY    (OCM__BASE + WM_PARENTNOTIFY)
  356.  
  357.  
  358. /////////////////////////////////////////////////////////////////////////////
  359. // Self-registration APIs (to be implemented by server DLL)
  360.  
  361. STDAPI DllRegisterServer(void);
  362. STDAPI DllUnregisterServer(void);
  363.  
  364.  
  365. /////////////////////////////////////////////////////////////////////////////
  366. // Property frame APIs
  367.  
  368. STDAPI OleCreatePropertyFrame(HWND hwndOwner, UINT x, UINT y,
  369.     LPCOLESTR lpszCaption, ULONG cObjects, LPUNKNOWN FAR* ppUnk, ULONG cPages,
  370.     LPCLSID pPageClsID, LCID lcid, DWORD dwReserved, LPVOID pvReserved);
  371.  
  372. STDAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams);
  373.  
  374.  
  375. /////////////////////////////////////////////////////////////////////////////
  376. // Standard type APIs
  377.  
  378. STDAPI OleTranslateColor(OLE_COLOR clr, HPALETTE hpal, COLORREF* lpcolorref);
  379.  
  380. STDAPI OleCreateFontIndirect(LPFONTDESC lpFontDesc, REFIID riid,
  381.     LPVOID FAR* lplpvObj);
  382.  
  383. STDAPI OleCreatePictureIndirect(LPPICTDESC lpPictDesc, REFIID riid, BOOL fOwn,
  384.     LPVOID FAR* lplpvObj);
  385.  
  386. STDAPI OleLoadPicture(LPSTREAM lpstream, LONG lSize, BOOL fRunmode,
  387.     REFIID riid, LPVOID FAR* lplpvObj);
  388.  
  389. STDAPI_(HCURSOR) OleIconToCursor(HINSTANCE hinstExe, HICON hIcon);
  390.  
  391.  
  392. /////////////////////////////////////////////////////////////////////////////
  393. // POINTF structure
  394.  
  395. typedef struct tagPOINTF
  396. {
  397.     float x;
  398.     float y;
  399.  
  400. } POINTF;
  401.  
  402.  
  403. /////////////////////////////////////////////////////////////////////////////
  404. // CONTROLINFO structure
  405.  
  406. typedef struct tagCONTROLINFO
  407. {
  408.     ULONG cb;       // Structure size
  409.     HACCEL hAccel;  // Control mnemonics
  410.     USHORT cAccel;  // Number of entries in mnemonics table
  411.     DWORD dwFlags;  // Flags chosen from below
  412.  
  413. } CONTROLINFO;
  414.  
  415. #define CTRLINFO_EATS_RETURN    1   // Control doesn't send Return to container
  416. #define CTRLINFO_EATS_ESCAPE    2   // Control doesn't send Escape to container
  417.  
  418.  
  419. /////////////////////////////////////////////////////////////////////////////
  420. // IOleControl interface
  421.  
  422. #undef  INTERFACE
  423. #define INTERFACE IOleControl
  424.  
  425. DECLARE_INTERFACE_(IOleControl, IUnknown)
  426. {
  427.     // IUnknown methods
  428.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  429.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  430.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  431.  
  432.     // IOleControl methods
  433.     STDMETHOD(GetControlInfo)(THIS_ LPCONTROLINFO pCI) PURE;
  434.     STDMETHOD(OnMnemonic)(THIS_ LPMSG pMsg) PURE;
  435.     STDMETHOD(OnAmbientPropertyChange)(THIS_ DISPID dispid) PURE;
  436.     STDMETHOD(FreezeEvents)(THIS_ BOOL bFreeze) PURE;
  437. };
  438.  
  439.  
  440. /////////////////////////////////////////////////////////////////////////////
  441. // IOleControlSite interface
  442.  
  443. #undef  INTERFACE
  444. #define INTERFACE IOleControlSite
  445.  
  446. DECLARE_INTERFACE_(IOleControlSite, IUnknown)
  447. {
  448.     // IUnknown methods
  449.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  450.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  451.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  452.  
  453.     // IOleControlSite methods
  454.     STDMETHOD(OnControlInfoChanged)(THIS) PURE;
  455.     STDMETHOD(LockInPlaceActive)(THIS_ BOOL fLock) PURE;
  456.     STDMETHOD(GetExtendedControl)(THIS_ LPDISPATCH FAR* ppDisp) PURE;
  457.     STDMETHOD(TransformCoords)(THIS_ POINTL FAR* lpptlHimetric,
  458.         POINTF FAR* lpptfContainer, DWORD flags) PURE;
  459.     STDMETHOD(TranslateAccelerator)(THIS_ LPMSG lpMsg, DWORD grfModifiers)
  460.         PURE;
  461.     STDMETHOD(OnFocus)(THIS_ BOOL fGotFocus) PURE;
  462.     STDMETHOD(ShowPropertyFrame)(THIS) PURE;
  463. };
  464.  
  465. #define XFORMCOORDS_POSITION            0x1
  466. #define XFORMCOORDS_SIZE                0x2
  467. #define XFORMCOORDS_HIMETRICTOCONTAINER 0x4
  468. #define XFORMCOORDS_CONTAINERTOHIMETRIC 0x8
  469.  
  470.  
  471. /////////////////////////////////////////////////////////////////////////////
  472. // ISimpleFrameSite interface
  473.  
  474. #undef  INTERFACE
  475. #define INTERFACE ISimpleFrameSite
  476.  
  477. DECLARE_INTERFACE_(ISimpleFrameSite, IUnknown)
  478. {
  479.     // IUnknown methods
  480.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  481.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  482.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  483.  
  484.     // ISimpleFrameSite methods
  485.     STDMETHOD(PreMessageFilter)(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
  486.         LRESULT FAR* lplResult, DWORD FAR * lpdwCookie) PURE;
  487.     STDMETHOD(PostMessageFilter)(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
  488.         LRESULT FAR* lplResult, DWORD dwCookie) PURE;
  489. };
  490.  
  491.  
  492. /////////////////////////////////////////////////////////////////////////////
  493. // IPersistStreamInit interface
  494.  
  495. #undef  INTERFACE
  496. #define INTERFACE IPersistStreamInit
  497.  
  498. DECLARE_INTERFACE_(IPersistStreamInit, IPersist)
  499. {
  500.     // IUnknown methods
  501.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  502.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  503.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  504.  
  505.     // IPersist methods
  506.     STDMETHOD(GetClassID)(THIS_ LPCLSID lpClassID) PURE;
  507.  
  508.     // IPersistStreamInit methods
  509.     STDMETHOD(IsDirty)(THIS) PURE;
  510.     STDMETHOD(Load)(THIS_ LPSTREAM pStm) PURE;
  511.     STDMETHOD(Save)(THIS_ LPSTREAM pStm, BOOL fClearDirty) PURE;
  512.     STDMETHOD(GetSizeMax)(THIS_ ULARGE_INTEGER FAR* pcbSize) PURE;
  513.     STDMETHOD(InitNew)(THIS) PURE;
  514. };
  515.  
  516.  
  517. /////////////////////////////////////////////////////////////////////////////
  518. // IPropertyNotifySink interface
  519.  
  520. #undef  INTERFACE
  521. #define INTERFACE IPropertyNotifySink
  522.  
  523. DECLARE_INTERFACE_(IPropertyNotifySink, 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.  
  530.     // IPropertyNotifySink methods
  531.     STDMETHOD(OnChanged)(THIS_ DISPID dispid) PURE;
  532.     STDMETHOD(OnRequestEdit)(THIS_ DISPID dispid) PURE;
  533. };
  534.  
  535.  
  536. /////////////////////////////////////////////////////////////////////////////
  537. // IProvideClassInfo interface
  538.  
  539. #undef  INTERFACE
  540. #define INTERFACE IProvideClassInfo
  541.  
  542. DECLARE_INTERFACE_(IProvideClassInfo, 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.  
  549.     // IProvideClassInfo methods
  550.     STDMETHOD(GetClassInfo)(THIS_ LPTYPEINFO FAR* ppTI) PURE;
  551. };
  552.  
  553.  
  554. /////////////////////////////////////////////////////////////////////////////
  555. // IConnectionPointContainer interface
  556.  
  557. #undef  INTERFACE
  558. #define INTERFACE IConnectionPointContainer
  559.  
  560. DECLARE_INTERFACE_(IConnectionPointContainer, IUnknown)
  561. {
  562.     // IUnknown methods
  563.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  564.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  565.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  566.  
  567.     // IConnectionPointContainer methods
  568.     STDMETHOD(EnumConnectionPoints)(THIS_ LPENUMCONNECTIONPOINTS FAR* ppEnum)
  569.         PURE;
  570.     STDMETHOD(FindConnectionPoint)(THIS_ REFIID iid,
  571.         LPCONNECTIONPOINT FAR* ppCP) PURE;
  572. };
  573.  
  574.  
  575. /////////////////////////////////////////////////////////////////////////////
  576. // IEnumConnectionPoint interface
  577.  
  578. #undef  INTERFACE
  579. #define INTERFACE IEnumConnectionPoints
  580.  
  581. DECLARE_INTERFACE_(IEnumConnectionPoints, IUnknown)
  582. {
  583.     // IUnknown methods
  584.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  585.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  586.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  587.  
  588.     // IEnumConnectionPoints methods
  589.     STDMETHOD(Next)(THIS_ ULONG cConnections, LPCONNECTIONPOINT FAR* rgpcn,
  590.         ULONG FAR* lpcFetched) PURE;
  591.     STDMETHOD(Skip)(THIS_ ULONG cConnections) PURE;
  592.     STDMETHOD(Reset)(THIS) PURE;
  593.     STDMETHOD(Clone)(THIS_ LPENUMCONNECTIONPOINTS FAR* ppEnum) PURE;
  594. };
  595.  
  596.  
  597. /////////////////////////////////////////////////////////////////////////////
  598. // IConnectionPoint interface
  599.  
  600. #undef  INTERFACE
  601. #define INTERFACE IConnectionPoint
  602.  
  603. DECLARE_INTERFACE_(IConnectionPoint, IUnknown)
  604. {
  605.     // IUnknown methods
  606.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  607.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  608.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  609.  
  610.     // IConnectionPoint methods
  611.     STDMETHOD(GetConnectionInterface)(THIS_ IID FAR* pIID) PURE;
  612.     STDMETHOD(GetConnectionPointContainer)(THIS_
  613.         IConnectionPointContainer FAR* FAR* ppCPC) PURE;
  614.     STDMETHOD(Advise)(THIS_ LPUNKNOWN pUnkSink, DWORD FAR* pdwCookie) PURE;
  615.     STDMETHOD(Unadvise)(THIS_ DWORD dwCookie) PURE;
  616.     STDMETHOD(EnumConnections)(THIS_ LPENUMCONNECTIONS FAR* ppEnum) PURE;
  617. };
  618.  
  619.  
  620. /////////////////////////////////////////////////////////////////////////////
  621. // CONNECTDATA structure
  622.  
  623. typedef struct tagCONNECTDATA
  624. {
  625.     LPUNKNOWN pUnk;
  626.     DWORD dwCookie;
  627.  
  628. } CONNECTDATA;
  629.  
  630.  
  631. /////////////////////////////////////////////////////////////////////////////
  632. // IEnumConnections interface
  633.  
  634. #undef  INTERFACE
  635. #define INTERFACE IEnumConnections
  636.  
  637. DECLARE_INTERFACE_(IEnumConnections, IUnknown)
  638. {
  639.     // IUnknown methods
  640.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  641.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  642.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  643.  
  644.     // IEnumConnections methods
  645.     STDMETHOD(Next)(THIS_ ULONG cConnections, LPCONNECTDATA rgcd,
  646.         ULONG FAR* lpcFetched) PURE;
  647.     STDMETHOD(Skip)(THIS_ ULONG cConnections) PURE;
  648.     STDMETHOD(Reset)(THIS) PURE;
  649.     STDMETHOD(Clone)(THIS_ LPENUMCONNECTIONS FAR* ppecn) PURE;
  650. };
  651.  
  652.  
  653. /////////////////////////////////////////////////////////////////////////////
  654. // LICINFO structure
  655.  
  656. typedef struct tagLICINFO
  657. {
  658.     long cbLicInfo;
  659.     BOOL fRuntimeKeyAvail;
  660.     BOOL fLicVerified;
  661.  
  662. } LICINFO;
  663.  
  664.  
  665. /////////////////////////////////////////////////////////////////////////////
  666. // IClassFactory2 interface
  667.  
  668. #undef  INTERFACE
  669. #define INTERFACE IClassFactory2
  670.  
  671. DECLARE_INTERFACE_(IClassFactory2, IClassFactory)
  672. {
  673.     // IUnknown methods
  674.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  675.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  676.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  677.  
  678.     // IClassFactory methods
  679.     STDMETHOD(CreateInstance)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid,
  680.         LPVOID FAR* ppvObject) PURE;
  681.     STDMETHOD(LockServer)(THIS_ BOOL fLock) PURE;
  682.  
  683.     //  IClassFactory2 methods
  684.     STDMETHOD(GetLicInfo)(THIS_ LPLICINFO pLicInfo) PURE;
  685.     STDMETHOD(RequestLicKey)(THIS_ DWORD dwResrved, BSTR FAR* pbstrKey) PURE;
  686.     STDMETHOD(CreateInstanceLic)(THIS_ LPUNKNOWN pUnkOuter,
  687.         LPUNKNOWN pUnkReserved, REFIID riid, BSTR bstrKey,
  688.         LPVOID FAR* ppvObject) PURE;
  689. };
  690.  
  691.  
  692. /////////////////////////////////////////////////////////////////////////////
  693. //  CAUUID structure - a counted array of UUIDs
  694.  
  695. #ifndef _tagCAUUID_DEFINED
  696. #define _tagCAUUID_DEFINED
  697. #define _CAUUID_DEFINED
  698.  
  699. typedef struct tagCAUUID
  700. {
  701.     ULONG cElems;
  702.     GUID FAR* pElems;
  703.  
  704. } CAUUID;
  705.  
  706. #endif
  707.  
  708.  
  709. /////////////////////////////////////////////////////////////////////////////
  710. //  CALPOLESTR structure - a counted array of LPOLESTRs
  711.  
  712. #ifndef _tagCALPOLESTR_DEFINED
  713. #define _tagCALPOLESTR_DEFINED
  714. #define _CALPOLESTR_DEFINED
  715.  
  716. typedef struct tagCALPOLESTR
  717. {
  718.     ULONG cElems;
  719.     LPOLESTR FAR* pElems;
  720.  
  721. } CALPOLESTR;
  722.  
  723. #endif
  724.  
  725.  
  726. /////////////////////////////////////////////////////////////////////////////
  727. //  CAUUID structure - a counted array of DWORDs
  728.  
  729. #ifndef _tagCADWORD_DEFINED
  730. #define _tagCADWORD_DEFINED
  731. #define _CADWORD_DEFINED
  732.  
  733. typedef struct tagCADWORD
  734. {
  735.     ULONG cElems;
  736.     DWORD FAR* pElems;
  737.  
  738. } CADWORD;
  739.  
  740. #endif
  741.  
  742.  
  743. /////////////////////////////////////////////////////////////////////////////
  744. // OCPFIPARAMS structure - parameters for OleCreatePropertyFrameIndirect
  745.  
  746. typedef struct tagOCPFIPARAMS
  747. {
  748.     ULONG cbStructSize;
  749.     HWND hWndOwner;
  750.     int x;
  751.     int y;
  752.     LPCOLESTR lpszCaption;
  753.     ULONG cObjects;
  754.     LPUNKNOWN FAR* lplpUnk;
  755.     ULONG cPages;
  756.     CLSID FAR* lpPages;
  757.     LCID lcid;
  758.     DISPID dispidInitialProperty;
  759.  
  760. } OCPFIPARAMS;
  761.  
  762.  
  763. /////////////////////////////////////////////////////////////////////////////
  764. // PROPPAGEINFO structure - information about a property page
  765.  
  766. typedef struct tagPROPPAGEINFO
  767. {
  768.     size_t cb;
  769.     LPOLESTR pszTitle;
  770.     SIZE size;
  771.     LPOLESTR pszDocString;
  772.     LPOLESTR pszHelpFile;
  773.     DWORD dwHelpContext;
  774.  
  775. } PROPPAGEINFO;
  776.  
  777.  
  778. /////////////////////////////////////////////////////////////////////////////
  779. // ISpecifyPropertyPages interface
  780.  
  781. #undef  INTERFACE
  782. #define INTERFACE ISpecifyPropertyPages
  783.  
  784. DECLARE_INTERFACE_(ISpecifyPropertyPages, IUnknown)
  785. {
  786.     // IUnknown methods
  787.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  788.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  789.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  790.  
  791.     // ISpecifyPropertyPages interface
  792.     STDMETHOD(GetPages)(THIS_ CAUUID FAR* pPages) PURE;
  793. };
  794.  
  795.  
  796. /////////////////////////////////////////////////////////////////////////////
  797. // IPerPropertyBrowsing interface
  798.  
  799. #undef  INTERFACE
  800. #define INTERFACE IPerPropertyBrowsing
  801.  
  802. DECLARE_INTERFACE_(IPerPropertyBrowsing, IUnknown)
  803. {
  804.     // IUnknown methods
  805.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  806.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  807.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  808.  
  809.     // IPerPropertyBrowsing interface
  810.     STDMETHOD(GetDisplayString)(THIS_ DISPID dispid, BSTR FAR* lpbstr) PURE;
  811.     STDMETHOD(MapPropertyToPage)(THIS_ DISPID dispid, LPCLSID lpclsid) PURE;
  812.     STDMETHOD(GetPredefinedStrings)(THIS_ DISPID dispid,
  813.         CALPOLESTR FAR* lpcaStringsOut, CADWORD FAR* lpcaCookiesOut) PURE;
  814.     STDMETHOD(GetPredefinedValue)(THIS_ DISPID dispid, DWORD dwCookie,
  815.         VARIANT FAR* lpvarOut) PURE;
  816. };
  817.  
  818.  
  819. /////////////////////////////////////////////////////////////////////////////
  820. // IPropertyPageSite interface
  821.  
  822. #undef  INTERFACE
  823. #define INTERFACE IPropertyPageSite
  824.  
  825. DECLARE_INTERFACE_(IPropertyPageSite, IUnknown)
  826. {
  827.     // IUnknown methods
  828.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  829.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  830.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  831.  
  832.     // IPropertyPageSite methods
  833.     STDMETHOD(OnStatusChange)(THIS_ DWORD flags) PURE;
  834.     STDMETHOD(GetLocaleID)(THIS_ LCID FAR* pLocaleID) PURE;
  835.     STDMETHOD(GetPageContainer)(THIS_ LPUNKNOWN FAR* ppUnk) PURE;
  836.     STDMETHOD(TranslateAccelerator)(THIS_ LPMSG lpMsg) PURE;
  837. };
  838.  
  839. #define PROPPAGESTATUS_DIRTY    0x1 // Values in page have changed
  840. #define PROPPAGESTATUS_VALIDATE 0x2 // Appropriate time to validate/apply
  841.  
  842.  
  843. /////////////////////////////////////////////////////////////////////////////
  844. // IPropertyPage interface
  845.  
  846. #undef  INTERFACE
  847. #define INTERFACE IPropertyPage
  848.  
  849. DECLARE_INTERFACE_(IPropertyPage, IUnknown)
  850. {
  851.     // IUnknown methods
  852.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  853.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  854.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  855.  
  856.     // IPropertyPage methods
  857.     STDMETHOD(SetPageSite)(THIS_ LPPROPERTYPAGESITE pPageSite) PURE;
  858.     STDMETHOD(Activate)(THIS_ HWND hwndParent, LPCRECT lprc, BOOL bModal) PURE;
  859.     STDMETHOD(Deactivate)(THIS) PURE;
  860.     STDMETHOD(GetPageInfo)(THIS_ LPPROPPAGEINFO pPageInfo) PURE;
  861.     STDMETHOD(SetObjects)(THIS_ ULONG cObjects, LPUNKNOWN FAR* ppunk) PURE;
  862.     STDMETHOD(Show)(THIS_ UINT nCmdShow) PURE;
  863.     STDMETHOD(Move)(LPCRECT prect) PURE;
  864.     STDMETHOD(IsPageDirty)(THIS) PURE;
  865.     STDMETHOD(Apply)(THIS) PURE;
  866.     STDMETHOD(Help)(THIS_ LPCOLESTR lpszHelpDir) PURE;
  867.     STDMETHOD(TranslateAccelerator)(THIS_ LPMSG lpMsg) PURE;
  868. };
  869.  
  870.  
  871. /////////////////////////////////////////////////////////////////////////////
  872. // IPropertyPage2 interface
  873.  
  874. #undef  INTERFACE
  875. #define INTERFACE IPropertyPage2
  876.  
  877. DECLARE_INTERFACE_(IPropertyPage2, IPropertyPage)
  878. {
  879.     // IUnknown methods
  880.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  881.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  882.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  883.  
  884.     // IPropertyPage methods
  885.     STDMETHOD(SetPageSite)(THIS_ LPPROPERTYPAGESITE pPageSite) PURE;
  886.     STDMETHOD(Activate)(THIS_ HWND hwndParent, LPCRECT lprc, BOOL bModal) PURE;
  887.     STDMETHOD(Deactivate)(THIS) PURE;
  888.     STDMETHOD(GetPageInfo)(THIS_ LPPROPPAGEINFO pPageInfo) PURE;
  889.     STDMETHOD(SetObjects)(THIS_ ULONG cObjects, LPUNKNOWN FAR* ppunk) PURE;
  890.     STDMETHOD(Show)(THIS_ UINT nCmdShow) PURE;
  891.     STDMETHOD(Move)(LPCRECT prect) PURE;
  892.     STDMETHOD(IsPageDirty)(THIS) PURE;
  893.     STDMETHOD(Apply)(THIS) PURE;
  894.     STDMETHOD(Help)(THIS_ LPCOLESTR lpszHelpDir) PURE;
  895.     STDMETHOD(TranslateAccelerator)(THIS_ LPMSG lpMsg) PURE;
  896.  
  897.     // IPropertyPage2 methods
  898.     STDMETHOD(EditProperty)(THIS_ DISPID dispid) PURE;
  899. };
  900.  
  901.  
  902. /////////////////////////////////////////////////////////////////////////////
  903. // IFont interface
  904.  
  905. #undef  INTERFACE
  906. #define INTERFACE IFont
  907.  
  908. DECLARE_INTERFACE_(IFont, IUnknown)
  909. {
  910.     // IUnknown methods
  911.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  912.     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  913.     STDMETHOD_(ULONG, Release)(THIS) PURE;
  914.  
  915.     // IFont methods
  916.     STDMETHOD(get_Name)(THIS_ BSTR FAR* pname) PURE;
  917.     STDMETHOD(put_Name)(THIS_ BSTR name) PURE;
  918.     STDMETHOD(get_Size)(THIS_ CY FAR* psize) PURE;
  919.     STDMETHOD(put_Size)(THIS_ CY size) PURE;
  920.     STDMETHOD(get_Bold)(THIS_ BOOL FAR* pbold) PURE;
  921.     STDMETHOD(put_Bold)(THIS_ BOOL bold) PURE;
  922.     STDMETHOD(get_Italic)(THIS_ BOOL FAR* pitalic) PURE;
  923.     STDMETHOD(put_Italic)(THIS_ BOOL italic) PURE;
  924.     STDMETHOD(get_Underline)(THIS_ BOOL FAR* punderline) PURE;
  925.     STDMETHOD(put_Underline)(THIS_ BOOL underline) PURE;
  926.     STDMETHOD(get_Strikethrough)(THIS_ BOOL FAR* pstrikethrough) PURE;
  927.     STDMETHOD(put_Strikethrough)(THIS_ BOOL strikethrough) PURE;
  928.     STDMETHOD(get_Weight)(THIS_ short FAR* pweight) PURE;
  929.     STDMETHOD(put_Weight)(THIS_ short weight) PURE;
  930.     STDMETHOD(get_Charset)(THIS_ short FAR* pcharset) PURE;
  931.     STDMETHOD(put_Charset)(THIS_ short charset) PURE;
  932.     STDMETHOD(get_hFont)(THIS_ HFONT FAR* phfont) PURE;
  933.     STDMETHOD(Clone)(THIS_ IFont FAR* FAR* lplpfont) PURE;
  934.     STDMETHOD(IsEqual)(THIS_ IFont FAR * lpFontOther) PURE;
  935.     STDMETHOD(SetRatio)(THIS_ long cyLogical, long cyHimetric) PURE;
  936.     STDMETHOD(QueryTextMetrics)(THIS_ LPTEXTMETRICOLE lptm) PURE;
  937.     STDMETHOD(AddRefHfont)(THIS_ HFONT hfont) PURE;
  938.     STDMETHOD(ReleaseHfont)(THIS_ HFONT hfont) PURE;
  939. };
  940.  
  941.  
  942. /////////////////////////////////////////////////////////////////////////////
  943. // IFontDisp interface
  944.  
  945. #undef  INTERFACE
  946. #define INTERFACE IFontDisp
  947.  
  948. DECLARE_INTERFACE_(IFontDisp, IDispatch)
  949. {
  950.     // IUnknown methods
  951.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  952.     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  953.     STDMETHOD_(ULONG, Release)(THIS) PURE;
  954.  
  955.     // IDispatch methods
  956.     STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE;
  957.     STDMETHOD(GetTypeInfo)(THIS_ UINT itinfo, LCID lcid,
  958.         ITypeInfo FAR* FAR* pptinfo) PURE;
  959.     STDMETHOD(GetIDsOfNames)(THIS_ REFIID riid, LPOLESTR FAR* rgszNames,
  960.         UINT cNames, LCID lcid, DISPID FAR* rgdispid) PURE;
  961.     STDMETHOD(Invoke)(THIS_ DISPID dispidMember, REFIID riid, LCID lcid,
  962.         WORD wFlags, DISPPARAMS FAR* pdispparams, VARIANT FAR* pvarResult,
  963.         EXCEPINFO FAR* pexcepinfo, UINT FAR* puArgErr) PURE;
  964. };
  965.  
  966.  
  967. /////////////////////////////////////////////////////////////////////////////
  968. // FONTDESC structure
  969.  
  970. #define FONTSIZE(n) { n##0000, 0 }
  971.  
  972. typedef struct tagFONTDESC
  973. {
  974.     UINT cbSizeofstruct;
  975.     LPOLESTR lpstrName;
  976.     CY cySize;
  977.     SHORT sWeight;
  978.     SHORT sCharset;
  979.     BOOL fItalic;
  980.     BOOL fUnderline;
  981.     BOOL fStrikethrough;
  982.  
  983. } FONTDESC;
  984.  
  985. /////////////////////////////////////////////////////////////////////////////
  986. // Picture attributes
  987.  
  988. #define PICTURE_SCALABLE        0x1l
  989. #define PICTURE_TRANSPARENT     0x2l
  990.  
  991. /////////////////////////////////////////////////////////////////////////////
  992. // IPicture interface
  993.  
  994. #undef  INTERFACE
  995. #define INTERFACE IPicture
  996.  
  997. DECLARE_INTERFACE_(IPicture, IUnknown)
  998. {
  999.     // IUnknown methods
  1000.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  1001.     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  1002.     STDMETHOD_(ULONG, Release)(THIS) PURE;
  1003.  
  1004.     // IPicture methods
  1005.     STDMETHOD(get_Handle)(THIS_ OLE_HANDLE FAR* phandle) PURE;
  1006.     STDMETHOD(get_hPal)(THIS_ OLE_HANDLE FAR* phpal) PURE;
  1007.     STDMETHOD(get_Type)(THIS_ short FAR* ptype) PURE;
  1008.     STDMETHOD(get_Width)(THIS_ OLE_XSIZE_HIMETRIC FAR* pwidth) PURE;
  1009.     STDMETHOD(get_Height)(THIS_ OLE_YSIZE_HIMETRIC FAR* pheight) PURE;
  1010.     STDMETHOD(Render)(THIS_ HDC hdc, long x, long y, long cx, long cy,
  1011.         OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
  1012.         OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
  1013.         LPCRECT lprcWBounds) PURE;
  1014.     STDMETHOD(set_hPal)(THIS_ OLE_HANDLE hpal) PURE;
  1015.     STDMETHOD(get_CurDC)(THIS_ HDC FAR * phdcOut) PURE;
  1016.     STDMETHOD(SelectPicture)(THIS_
  1017.         HDC hdcIn, HDC FAR * phdcOut, OLE_HANDLE FAR * phbmpOut) PURE;
  1018.     STDMETHOD(get_KeepOriginalFormat)(THIS_ BOOL * pfkeep) PURE;
  1019.     STDMETHOD(put_KeepOriginalFormat)(THIS_ BOOL fkeep) PURE;
  1020.     STDMETHOD(PictureChanged)(THIS) PURE;
  1021.     STDMETHOD(SaveAsFile)(THIS_ LPSTREAM lpstream, BOOL fSaveMemCopy,
  1022.         LONG FAR * lpcbSize) PURE;
  1023.     STDMETHOD(get_Attributes)(THIS_ DWORD FAR * lpdwAttr) PURE;
  1024.  
  1025. };
  1026.  
  1027. /////////////////////////////////////////////////////////////////////////////
  1028. // IPictureDisp interface
  1029.  
  1030. #undef  INTERFACE
  1031. #define INTERFACE IPictureDisp
  1032.  
  1033. DECLARE_INTERFACE_(IPictureDisp, IDispatch)
  1034. {
  1035.     // IUnknown methods
  1036.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  1037.     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  1038.     STDMETHOD_(ULONG, Release)(THIS) PURE;
  1039.  
  1040.     // IDispatch methods
  1041.     STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE;
  1042.     STDMETHOD(GetTypeInfo)(THIS_ UINT itinfo, LCID lcid,
  1043.         ITypeInfo FAR* FAR* pptinfo) PURE;
  1044.     STDMETHOD(GetIDsOfNames)(THIS_ REFIID riid, LPOLESTR FAR* rgszNames,
  1045.         UINT cNames, LCID lcid, DISPID FAR* rgdispid) PURE;
  1046.     STDMETHOD(Invoke)(THIS_ DISPID dispidMember, REFIID riid, LCID lcid,
  1047.         WORD wFlags, DISPPARAMS FAR* pdispparams, VARIANT FAR* pvarResult,
  1048.         EXCEPINFO FAR* pexcepinfo, UINT FAR* puArgErr) PURE;
  1049. };
  1050.  
  1051.  
  1052. /////////////////////////////////////////////////////////////////////////////
  1053. // PICTDESC structure
  1054.  
  1055. #define PICTYPE_UNINITIALIZED   ((UINT)-1)
  1056. #define PICTYPE_NONE        0
  1057. #define PICTYPE_BITMAP      1
  1058. #define PICTYPE_METAFILE    2
  1059. #define PICTYPE_ICON        3
  1060.  
  1061. typedef struct tagPICTDESC
  1062. {
  1063.     UINT cbSizeofstruct;
  1064.     UINT picType;
  1065.     union
  1066.     {
  1067.         struct
  1068.         {
  1069.             HBITMAP   hbitmap;        // Bitmap
  1070.             HPALETTE  hpal;           // Accompanying palette
  1071.         } bmp;
  1072.  
  1073.         struct
  1074.         {
  1075.             HMETAFILE hmeta;          // Metafile
  1076.             int       xExt;
  1077.             int       yExt;           // Extent
  1078.         } wmf;
  1079.  
  1080.         struct
  1081.         {
  1082.             HICON hicon;              // Icon
  1083.         } icon;
  1084.     }
  1085. #if defined(NONAMELESSUNION)
  1086.     u
  1087. #endif
  1088.     ;
  1089.  
  1090. } PICTDESC;
  1091.  
  1092.  
  1093. #ifdef _WIN32
  1094. #ifndef RC_INVOKED
  1095. #pragma pack()
  1096. #endif // not RC_INVOKED
  1097. #endif // _WIN32
  1098.  
  1099. #endif // not __MKTYPLIB__
  1100.  
  1101.  
  1102. /////////////////////////////////////////////////////////////////////////////
  1103. //  Standard dispatch ID constants
  1104.  
  1105. #define DISPID_AUTOSIZE                 (-500)
  1106. #define DISPID_BACKCOLOR                (-501)
  1107. #define DISPID_BACKSTYLE                (-502)
  1108. #define DISPID_BORDERCOLOR              (-503)
  1109. #define DISPID_BORDERSTYLE              (-504)
  1110. #define DISPID_BORDERWIDTH              (-505)
  1111. #define DISPID_DRAWMODE                 (-507)
  1112. #define DISPID_DRAWSTYLE                (-508)
  1113. #define DISPID_DRAWWIDTH                (-509)
  1114. #define DISPID_FILLCOLOR                (-510)
  1115. #define DISPID_FILLSTYLE                (-511)
  1116. #define DISPID_FONT                     (-512)
  1117. #define DISPID_FORECOLOR                (-513)
  1118. #define DISPID_ENABLED                  (-514)
  1119. #define DISPID_HWND                     (-515)
  1120. #define DISPID_TABSTOP                  (-516)
  1121. #define DISPID_TEXT                     (-517)
  1122. #define DISPID_CAPTION                  (-518)
  1123. #define DISPID_BORDERVISIBLE            (-519)
  1124.  
  1125. #define DISPID_REFRESH                  (-550)
  1126. #define DISPID_DOCLICK                  (-551)
  1127. #define DISPID_ABOUTBOX                 (-552)
  1128.  
  1129. #define DISPID_CLICK                    (-600)
  1130. #define DISPID_DBLCLICK                 (-601)
  1131. #define DISPID_KEYDOWN                  (-602)
  1132. #define DISPID_KEYPRESS                 (-603)
  1133. #define DISPID_KEYUP                    (-604)
  1134. #define DISPID_MOUSEDOWN                (-605)
  1135. #define DISPID_MOUSEMOVE                (-606)
  1136. #define DISPID_MOUSEUP                  (-607)
  1137. #define DISPID_ERROREVENT               (-608)
  1138.  
  1139. #define DISPID_AMBIENT_BACKCOLOR        (-701)
  1140. #define DISPID_AMBIENT_DISPLAYNAME      (-702)
  1141. #define DISPID_AMBIENT_FONT             (-703)
  1142. #define DISPID_AMBIENT_FORECOLOR        (-704)
  1143. #define DISPID_AMBIENT_LOCALEID         (-705)
  1144. #define DISPID_AMBIENT_MESSAGEREFLECT   (-706)
  1145. #define DISPID_AMBIENT_SCALEUNITS       (-707)
  1146. #define DISPID_AMBIENT_TEXTALIGN        (-708)
  1147. #define DISPID_AMBIENT_USERMODE         (-709)
  1148. #define DISPID_AMBIENT_UIDEAD           (-710)
  1149. #define DISPID_AMBIENT_SHOWGRABHANDLES  (-711)
  1150. #define DISPID_AMBIENT_SHOWHATCHING     (-712)
  1151. #define DISPID_AMBIENT_DISPLAYASDEFAULT (-713)
  1152. #define DISPID_AMBIENT_SUPPORTSMNEMONICS (-714)
  1153. #define DISPID_AMBIENT_AUTOCLIP         (-715)
  1154.  
  1155.  
  1156. /////////////////////////////////////////////////////////////////////////////
  1157. // Dispatch ID constants for font and picture types
  1158.  
  1159. #define DISPID_FONT_NAME    0
  1160. #define DISPID_FONT_SIZE    2
  1161. #define DISPID_FONT_BOLD    3
  1162. #define DISPID_FONT_ITALIC  4
  1163. #define DISPID_FONT_UNDER   5
  1164. #define DISPID_FONT_STRIKE  6
  1165. #define DISPID_FONT_WEIGHT  7
  1166. #define DISPID_FONT_CHARSET 8
  1167.  
  1168. #define DISPID_PICT_HANDLE  0
  1169. #define DISPID_PICT_HPAL    2
  1170. #define DISPID_PICT_TYPE    3
  1171. #define DISPID_PICT_WIDTH   4
  1172. #define DISPID_PICT_HEIGHT  5
  1173. #define DISPID_PICT_RENDER  6
  1174.  
  1175.  
  1176. #ifdef __MKTYPLIB__
  1177.  
  1178. /////////////////////////////////////////////////////////////////////////////
  1179. // Names of modules containing type libraries for standard types
  1180.  
  1181. #ifdef _WIN32
  1182. #define STDOLE_TLB "stdole32.tlb"
  1183. #else
  1184. #define STDOLE_TLB "stdole.tlb"
  1185. #endif
  1186.  
  1187. #endif // __MKTYPLIB__
  1188.  
  1189. #endif // _OLECTL_H_
  1190.