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.

2065 lines
68 KiB

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. /////////////////////////////////////////////////////////////////////////////
  11. // AFXCTL.H - MFC OLE Control support
  12. #ifndef __AFXCTL_H__
  13. #define __AFXCTL_H__
  14. // make sure afxole.h is included first
  15. #ifndef __AFXOLE_H__
  16. #include <afxole.h>
  17. #endif
  18. #ifdef _AFX_MINREBUILD
  19. #pragma component(minrebuild, off)
  20. #endif
  21. #ifndef _AFX_FULLTYPEINFO
  22. #pragma component(mintypeinfo, on)
  23. #endif
  24. /////////////////////////////////////////////////////////////////////////////
  25. // Classes declared in this file
  26. //CWinApp
  27. class COleControlModule; // Module housekeeping for an .OCX
  28. class CFontHolder; // For manipulating font objects
  29. class CPictureHolder; // For manipulating picture objects
  30. //CWnd
  31. class COleControl; // OLE Control
  32. //CDialog
  33. class COlePropertyPage; // OLE Property page
  34. #if _MFC_VER >= 0x0600
  35. class CStockPropPage;
  36. class CColorPropPage;
  37. class CFontPropPage;
  38. class CPicturePropPage;
  39. #endif
  40. class CPropExchange; // Abstract base for property exchange
  41. //CAsyncMonikerFile
  42. class CDataPathProperty; // Asynchronous properties for OLE Controls
  43. class CCachedDataPathProperty; // Cached asynchronous properties for OLE Controls
  44. /////////////////////////////////////////////////////////////////////////////
  45. // Set structure packing
  46. #ifdef _AFX_PACKING
  47. #pragma pack(push, _AFX_PACKING)
  48. #endif
  49. /////////////////////////////////////////////////////////////////////////////
  50. // MFC data definition for data exported from the runtime DLL
  51. #undef AFX_DATA
  52. #define AFX_DATA AFX_OLE_DATA
  53. /////////////////////////////////////////////////////////////////////////////
  54. // COleControlModule - base class for .OCX module
  55. // This object is statically linked into the control.
  56. class COleControlModule : public CWinApp
  57. {
  58. DECLARE_DYNAMIC(COleControlModule)
  59. public:
  60. virtual BOOL InitInstance();
  61. virtual int ExitInstance();
  62. };
  63. /////////////////////////////////////////////////////////////////////////////
  64. // Module state macro
  65. #define AfxGetControlModuleContext AfxGetStaticModuleState
  66. #define _afxModuleAddrThis AfxGetStaticModuleState()
  67. /////////////////////////////////////////////////////////////////////////////
  68. // Connection helper functions
  69. BOOL AFXAPI AfxConnectionAdvise(LPUNKNOWN pUnkSrc, REFIID iid,
  70. LPUNKNOWN pUnkSink, BOOL bRefCount, DWORD* pdwCookie);
  71. BOOL AFXAPI AfxConnectionUnadvise(LPUNKNOWN pUnkSrc, REFIID iid,
  72. LPUNKNOWN pUnkSink, BOOL bRefCount, DWORD dwCookie);
  73. /////////////////////////////////////////////////////////////////////////////
  74. // Event maps
  75. enum AFX_EVENTMAP_FLAGS
  76. {
  77. afxEventCustom = 0,
  78. afxEventStock = 1,
  79. };
  80. struct AFX_EVENTMAP_ENTRY
  81. {
  82. AFX_EVENTMAP_FLAGS flags;
  83. DISPID dispid;
  84. LPCTSTR pszName;
  85. LPCSTR lpszParams;
  86. };
  87. struct AFX_EVENTMAP
  88. {
  89. const AFX_EVENTMAP* lpBaseEventMap;
  90. const AFX_EVENTMAP_ENTRY* lpEntries;
  91. DWORD* lpStockEventMask;
  92. };
  93. #define DECLARE_EVENT_MAP() \
  94. private: \
  95. static const AFX_DATA AFX_EVENTMAP_ENTRY _eventEntries[]; \
  96. static DWORD _dwStockEventMask; \
  97. protected: \
  98. static const AFX_DATA AFX_EVENTMAP eventMap; \
  99. virtual const AFX_EVENTMAP* GetEventMap() const;
  100. #define BEGIN_EVENT_MAP(theClass, baseClass) \
  101. const AFX_EVENTMAP* theClass::GetEventMap() const \
  102. { return &eventMap; } \
  103. const AFX_DATADEF AFX_EVENTMAP theClass::eventMap = \
  104. { &(baseClass::eventMap), theClass::_eventEntries, \
  105. &theClass::_dwStockEventMask }; \
  106. AFX_COMDAT DWORD theClass::_dwStockEventMask = (DWORD)-1; \
  107. AFX_COMDAT const AFX_DATADEF AFX_EVENTMAP_ENTRY theClass::_eventEntries[] = \
  108. {
  109. #define END_EVENT_MAP() \
  110. { afxEventCustom, DISPID_UNKNOWN, NULL, NULL }, \
  111. };
  112. #define EVENT_CUSTOM(pszName, pfnFire, vtsParams) \
  113. { afxEventCustom, DISPID_UNKNOWN, _T(pszName), vtsParams },
  114. #define EVENT_CUSTOM_ID(pszName, dispid, pfnFire, vtsParams) \
  115. { afxEventCustom, dispid, _T(pszName), vtsParams },
  116. #define EVENT_PARAM(vtsParams) (BYTE*)(vtsParams)
  117. /////////////////////////////////////////////////////////////////////////////
  118. // Stock events
  119. #define EVENT_STOCK_CLICK() \
  120. { afxEventStock, DISPID_CLICK, _T("Click"), VTS_NONE },
  121. #define EVENT_STOCK_DBLCLICK() \
  122. { afxEventStock, DISPID_DBLCLICK, _T("DblClick"), VTS_NONE },
  123. #define EVENT_STOCK_KEYDOWN() \
  124. { afxEventStock, DISPID_KEYDOWN, _T("KeyDown"), VTS_PI2 VTS_I2 },
  125. #define EVENT_STOCK_KEYPRESS() \
  126. { afxEventStock, DISPID_KEYPRESS, _T("KeyPress"), VTS_PI2 },
  127. #define EVENT_STOCK_KEYUP() \
  128. { afxEventStock, DISPID_KEYUP, _T("KeyUp"), VTS_PI2 VTS_I2 },
  129. #define EVENT_STOCK_MOUSEDOWN() \
  130. { afxEventStock, DISPID_MOUSEDOWN, _T("MouseDown"), \
  131. VTS_I2 VTS_I2 VTS_XPOS_PIXELS VTS_YPOS_PIXELS },
  132. #define EVENT_STOCK_MOUSEMOVE() \
  133. { afxEventStock, DISPID_MOUSEMOVE, _T("MouseMove"), \
  134. VTS_I2 VTS_I2 VTS_XPOS_PIXELS VTS_YPOS_PIXELS },
  135. #define EVENT_STOCK_MOUSEUP() \
  136. { afxEventStock, DISPID_MOUSEUP, _T("MouseUp"), \
  137. VTS_I2 VTS_I2 VTS_XPOS_PIXELS VTS_YPOS_PIXELS },
  138. #define EVENT_STOCK_ERROREVENT() \
  139. { afxEventStock, DISPID_ERROREVENT, _T("Error"), \
  140. VTS_I2 VTS_PBSTR VTS_SCODE VTS_BSTR VTS_BSTR VTS_I4 VTS_PBOOL },
  141. #define EVENT_STOCK_READYSTATECHANGE() \
  142. { afxEventStock, DISPID_READYSTATECHANGE, _T("ReadyStateChange"), \
  143. VTS_I4 },
  144. // Shift state values for mouse and keyboard events
  145. #define SHIFT_MASK 0x01
  146. #define CTRL_MASK 0x02
  147. #define ALT_MASK 0x04
  148. // Button values for mouse events
  149. #define LEFT_BUTTON 0x01
  150. #define RIGHT_BUTTON 0x02
  151. #define MIDDLE_BUTTON 0x04
  152. /////////////////////////////////////////////////////////////////////////////
  153. // Stock properties
  154. #define DISP_PROPERTY_STOCK(theClass, szExternalName, dispid, pfnGet, pfnSet, vtPropType) \
  155. { _T(szExternalName), dispid, NULL, vtPropType, \
  156. (AFX_PMSG)(void (theClass::*)(void))&pfnGet, \
  157. (AFX_PMSG)(void (theClass::*)(void))&pfnSet, 0, afxDispStock }, \
  158. #define DISP_STOCKPROP_APPEARANCE() \
  159. DISP_PROPERTY_STOCK(COleControl, "Appearance", DISPID_APPEARANCE, \
  160. COleControl::GetAppearance, COleControl::SetAppearance, VT_I2)
  161. #define DISP_STOCKPROP_BACKCOLOR() \
  162. DISP_PROPERTY_STOCK(COleControl, "BackColor", DISPID_BACKCOLOR, \
  163. COleControl::GetBackColor, COleControl::SetBackColor, VT_COLOR)
  164. #define DISP_STOCKPROP_BORDERSTYLE() \
  165. DISP_PROPERTY_STOCK(COleControl, "BorderStyle", DISPID_BORDERSTYLE, \
  166. COleControl::GetBorderStyle, COleControl::SetBorderStyle, VT_I2)
  167. #define DISP_STOCKPROP_CAPTION() \
  168. DISP_PROPERTY_STOCK(COleControl, "Caption", DISPID_CAPTION, \
  169. COleControl::GetText, COleControl::SetText, VT_BSTR)
  170. #define DISP_STOCKPROP_ENABLED() \
  171. DISP_PROPERTY_STOCK(COleControl, "Enabled", DISPID_ENABLED, \
  172. COleControl::GetEnabled, COleControl::SetEnabled, VT_BOOL)
  173. #define DISP_STOCKPROP_FONT() \
  174. DISP_PROPERTY_STOCK(COleControl, "Font", DISPID_FONT, \
  175. COleControl::GetFont, COleControl::SetFont, VT_FONT)
  176. #define DISP_STOCKPROP_FORECOLOR() \
  177. DISP_PROPERTY_STOCK(COleControl, "ForeColor", DISPID_FORECOLOR, \
  178. COleControl::GetForeColor, COleControl::SetForeColor, VT_COLOR)
  179. #define DISP_STOCKPROP_HWND() \
  180. DISP_PROPERTY_STOCK(COleControl, "hWnd", DISPID_HWND, \
  181. COleControl::GetHwnd, SetNotSupported, VT_HANDLE)
  182. #define DISP_STOCKPROP_TEXT() \
  183. DISP_PROPERTY_STOCK(COleControl, "Text", DISPID_TEXT, \
  184. COleControl::GetText, COleControl::SetText, VT_BSTR)
  185. #define DISP_STOCKPROP_READYSTATE() \
  186. DISP_PROPERTY_STOCK(COleControl, "ReadyState", DISPID_READYSTATE, \
  187. COleControl::GetReadyState, SetNotSupported, VT_I4)
  188. /////////////////////////////////////////////////////////////////////////////
  189. // Stock methods
  190. #define DISP_FUNCTION_STOCK(theClass, szExternalName, dispid, pfnMember, vtRetVal, vtsParams) \
  191. { _T(szExternalName), dispid, vtsParams, vtRetVal, \
  192. (AFX_PMSG)(void (theClass::*)(void))&pfnMember, (AFX_PMSG)0, 0, \
  193. afxDispStock }, \
  194. #define DISP_STOCKFUNC_REFRESH() \
  195. DISP_FUNCTION_STOCK(COleControl, "Refresh", DISPID_REFRESH, \
  196. COleControl::Refresh, VT_EMPTY, VTS_NONE)
  197. #define DISP_STOCKFUNC_DOCLICK() \
  198. DISP_FUNCTION_STOCK(COleControl, "DoClick", DISPID_DOCLICK, \
  199. COleControl::DoClick, VT_EMPTY, VTS_NONE)
  200. /////////////////////////////////////////////////////////////////////////////
  201. // Macros for object factory and class ID
  202. #define BEGIN_OLEFACTORY(class_name) \
  203. protected: \
  204. class class_name##Factory : public COleObjectFactoryEx \
  205. { \
  206. public: \
  207. class_name##Factory(REFCLSID clsid, CRuntimeClass* pRuntimeClass, \
  208. BOOL bMultiInstance, LPCTSTR lpszProgID) : \
  209. COleObjectFactoryEx(clsid, pRuntimeClass, bMultiInstance, \
  210. lpszProgID) {} \
  211. virtual BOOL UpdateRegistry(BOOL);
  212. #define END_OLEFACTORY(class_name) \
  213. }; \
  214. friend class class_name##Factory; \
  215. static AFX_DATA class_name##Factory factory; \
  216. public: \
  217. static AFX_DATA const GUID guid; \
  218. virtual HRESULT GetClassID(LPCLSID pclsid);
  219. #define DECLARE_OLECREATE_EX(class_name) \
  220. BEGIN_OLEFACTORY(class_name) \
  221. END_OLEFACTORY(class_name)
  222. #if _MFC_VER >= 0x0600
  223. #define IMPLEMENT_OLECREATE_EX(class_name, external_name, \
  224. l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
  225. const TCHAR _szProgID_##class_name[] = _T(external_name); \
  226. AFX_DATADEF class_name::class_name##Factory class_name::factory( \
  227. class_name::guid, RUNTIME_CLASS(class_name), FALSE, \
  228. _szProgID_##class_name); \
  229. const AFX_DATADEF GUID class_name::guid = \
  230. { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }; \
  231. HRESULT class_name::GetClassID(LPCLSID pclsid) \
  232. { *pclsid = guid; return NOERROR; }
  233. #else
  234. #define IMPLEMENT_OLECREATE_EX(class_name, external_name, \
  235. l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
  236. static const TCHAR _szProgID_##class_name[] = _T(external_name); \
  237. AFX_DATADEF class_name::class_name##Factory class_name::factory( \
  238. class_name::guid, RUNTIME_CLASS(class_name), FALSE, \
  239. _szProgID_##class_name); \
  240. const AFX_DATADEF GUID class_name::guid = \
  241. { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }; \
  242. HRESULT class_name::GetClassID(LPCLSID pclsid) \
  243. { *pclsid = guid; return NOERROR; }
  244. #endif
  245. /////////////////////////////////////////////////////////////////////////////
  246. // Macros for type name and misc status
  247. #define DECLARE_OLECTLTYPE(class_name) \
  248. virtual UINT GetUserTypeNameID(); \
  249. virtual DWORD GetMiscStatus();
  250. #define IMPLEMENT_OLECTLTYPE(class_name, idsUserTypeName, dwOleMisc) \
  251. UINT class_name::GetUserTypeNameID() { return idsUserTypeName; } \
  252. DWORD class_name::GetMiscStatus() { return dwOleMisc; }
  253. /////////////////////////////////////////////////////////////////////////////
  254. // Macros for property page IDs
  255. #define DECLARE_PROPPAGEIDS(class_name) \
  256. protected: \
  257. virtual LPCLSID GetPropPageIDs(ULONG& cPropPages);
  258. #if _MFC_VER >= 0x0600
  259. #define BEGIN_PROPPAGEIDS(class_name, count) \
  260. static CLSID _rgPropPageIDs_##class_name[count]; \
  261. AFX_COMDAT ULONG _cPropPages_##class_name = (ULONG)-1; \
  262. LPCLSID class_name::GetPropPageIDs(ULONG& cPropPages) { \
  263. if (_cPropPages_##class_name == (ULONG)-1) { \
  264. _cPropPages_##class_name = count; \
  265. LPCLSID pIDs = _rgPropPageIDs_##class_name; \
  266. ULONG iPageMax = count; \
  267. ULONG iPage = 0;
  268. #else
  269. #define BEGIN_PROPPAGEIDS(class_name, count) \
  270. static CLSID _rgPropPageIDs_##class_name[count]; \
  271. static ULONG _cPropPages_##class_name = (ULONG)-1; \
  272. LPCLSID class_name::GetPropPageIDs(ULONG& cPropPages) { \
  273. if (_cPropPages_##class_name == (ULONG)-1) { \
  274. _cPropPages_##class_name = count; \
  275. LPCLSID pIDs = _rgPropPageIDs_##class_name; \
  276. ULONG iPageMax = count; \
  277. ULONG iPage = 0;
  278. #endif
  279. #define PROPPAGEID(clsid) \
  280. ASSERT(iPage < iPageMax); \
  281. if (iPage < iPageMax) \
  282. pIDs[iPage++] = clsid;
  283. #define END_PROPPAGEIDS(class_name) \
  284. ASSERT(iPage == iPageMax); \
  285. } \
  286. cPropPages = _cPropPages_##class_name; \
  287. return _rgPropPageIDs_##class_name; }
  288. /////////////////////////////////////////////////////////////////////////////
  289. // CFontHolder - helper class for dealing with font objects
  290. class CFontHolder
  291. {
  292. // Constructors
  293. public:
  294. CFontHolder(LPPROPERTYNOTIFYSINK pNotify);
  295. // Attributes
  296. LPFONT m_pFont;
  297. // Operations
  298. void InitializeFont(
  299. const FONTDESC* pFontDesc = NULL,
  300. LPDISPATCH pFontDispAmbient = NULL);
  301. void SetFont(LPFONT pNewFont);
  302. void ReleaseFont();
  303. HFONT GetFontHandle();
  304. HFONT GetFontHandle(long cyLogical, long cyHimetric);
  305. CFont* Select(CDC* pDC, long cyLogical, long cyHimetric);
  306. BOOL GetDisplayString(CString& strValue);
  307. LPFONTDISP GetFontDispatch();
  308. void QueryTextMetrics(LPTEXTMETRIC lptm);
  309. // Implementation
  310. public:
  311. ~CFontHolder();
  312. #if _MFC_VER >= 0x0600
  313. void SetFontNotifySink(LPPROPERTYNOTIFYSINK pNotify);
  314. #endif
  315. protected:
  316. DWORD m_dwConnectCookie;
  317. LPPROPERTYNOTIFYSINK m_pNotify;
  318. };
  319. /////////////////////////////////////////////////////////////////////////////
  320. // CPictureHolder - helper class for dealing with picture objects
  321. class CPictureHolder
  322. {
  323. // Constructors
  324. public:
  325. CPictureHolder();
  326. // Attributes
  327. LPPICTURE m_pPict;
  328. // Operations
  329. BOOL CreateEmpty();
  330. BOOL CreateFromBitmap(UINT idResource);
  331. BOOL CreateFromBitmap(CBitmap* pBitmap, CPalette* pPal = NULL,
  332. BOOL bTransferOwnership = TRUE);
  333. BOOL CreateFromBitmap(HBITMAP hbm, HPALETTE hpal = NULL,
  334. BOOL bTransferOwnership = FALSE);
  335. BOOL CreateFromMetafile(HMETAFILE hmf, int xExt, int yExt,
  336. BOOL bTransferOwnership = FALSE);
  337. BOOL CreateFromIcon(UINT idResource);
  338. BOOL CreateFromIcon(HICON hIcon, BOOL bTransferOwnership = FALSE);
  339. short GetType();
  340. BOOL GetDisplayString(CString& strValue);
  341. LPPICTUREDISP GetPictureDispatch();
  342. void SetPictureDispatch(LPPICTUREDISP pDisp);
  343. void Render(CDC* pDC, const CRect& rcRender, const CRect& rcWBounds);
  344. // Implementation
  345. public:
  346. ~CPictureHolder();
  347. };
  348. /////////////////////////////////////////////////////////////////////////////
  349. // CDataPathProperty - Asynchonous properties for OLE Controls
  350. class CDataPathProperty: public CAsyncMonikerFile
  351. {
  352. DECLARE_DYNAMIC(CDataPathProperty)
  353. // Constructors
  354. public:
  355. CDataPathProperty(COleControl* pControl = NULL);
  356. CDataPathProperty(LPCTSTR lpszPath, COleControl* pControl = NULL);
  357. // Calls SetPath(pControl) and SetPath(lpszPath) as appropriate.
  358. // Attributes
  359. public:
  360. void SetPath(LPCTSTR lpszPath);
  361. // Sets the path to be opened by Open(COleControl*) and Open()
  362. // lpszPath may be NULL.
  363. CString GetPath() const;
  364. // Returns the current path setting. Result may be empty.
  365. COleControl* GetControl();
  366. // Returns a Pointer to the control. Result may be NULL.
  367. void SetControl(COleControl* pControl);
  368. // Sets the control which will be used with Open. pControl may be NULL.
  369. // Operations
  370. public:
  371. // Overloads of Open takings some or all of: a path, a control,
  372. // and a CFileException
  373. // Overloads taking a COleControl call SetControl(pControl)
  374. // Overloads taking an LPCTSTR cal SetPath(lpszPath)
  375. virtual BOOL Open(COleControl* pControl, CFileException* pError = NULL);
  376. virtual BOOL Open(LPCTSTR lpszPath, COleControl* pControl,
  377. CFileException* pError = NULL);
  378. virtual BOOL Open(LPCTSTR lpszPath, CFileException* pError = NULL);
  379. virtual BOOL Open(CFileException* pError = NULL);
  380. // Attempts to obtain an IBindHost* from the control returned by
  381. // GetControl(). Calls CAsyncMonikerFile::Open with the path returned by
  382. // GetPath() and, if it was obtained, the IBindHost*.
  383. // Returns TRUE if successful.
  384. // Overridables
  385. public:
  386. virtual void ResetData();
  387. // Derived classes should overide this.
  388. // Implementation
  389. public:
  390. #ifdef _DEBUG
  391. virtual void AssertValid() const;
  392. virtual void Dump(CDumpContext& dc) const;
  393. #endif
  394. private:
  395. COleControl* m_pControl;
  396. CString m_strPath;
  397. };
  398. /////////////////////////////////////////////////////////////////////////////
  399. // CCachedDataPathProperty - Cached asynchonous properties for OLE Controls
  400. class CCachedDataPathProperty : public CDataPathProperty
  401. {
  402. DECLARE_DYNAMIC(CCachedDataPathProperty)
  403. //Constructors
  404. public:
  405. CCachedDataPathProperty(COleControl* pControl = NULL);
  406. CCachedDataPathProperty(LPCTSTR lpszPath, COleControl* pControl = NULL);
  407. // Attributes
  408. public:
  409. CMemFile m_Cache;
  410. // Implementation
  411. public:
  412. virtual void OnDataAvailable(DWORD dwSize, DWORD bscfFlag);
  413. virtual void Close();
  414. virtual void ResetData();
  415. #ifdef _DEBUG
  416. virtual void AssertValid() const;
  417. virtual void Dump(CDumpContext& dc) const;
  418. #endif
  419. };
  420. /////////////////////////////////////////////////////////////////////////////
  421. // COleControl - base class for a control implemented in C++ with MFC
  422. struct _AFXCTL_ADVISE_INFO; // implementation class
  423. struct _AFXCTL_UIACTIVE_INFO; // implementation class
  424. #if _MFC_VER >= 0x0600
  425. class CControlRectTracker : public CRectTracker
  426. {
  427. // Implementation
  428. public:
  429. CControlRectTracker(LPCRECT lpSrcRect, UINT nStyle)
  430. : CRectTracker(lpSrcRect, nStyle) { }
  431. CRect m_rectClip; // saves the original clipping rectangle
  432. };
  433. #endif
  434. #ifdef _AFXDLL
  435. class COleControl : public CWnd
  436. #else
  437. class AFX_NOVTABLE COleControl : public CWnd
  438. #endif
  439. {
  440. DECLARE_DYNAMIC(COleControl)
  441. // Constructors
  442. public:
  443. COleControl();
  444. // Operations
  445. // Initialization
  446. void SetInitialSize(int cx, int cy);
  447. void InitializeIIDs(const IID* piidPrimary, const IID* piidEvents);
  448. // Invalidating
  449. void InvalidateControl(LPCRECT lpRect = NULL, BOOL bErase = TRUE);
  450. // Modified flag
  451. BOOL IsModified();
  452. void SetModifiedFlag(BOOL bModified = TRUE);
  453. // Drawing operations
  454. void DoSuperclassPaint(CDC* pDC, const CRect& rcBounds);
  455. BOOL IsOptimizedDraw();
  456. // Property exchange
  457. BOOL ExchangeVersion(CPropExchange* pPX, DWORD dwVersionDefault,
  458. BOOL bConvert = TRUE);
  459. BOOL ExchangeExtent(CPropExchange* pPX);
  460. void ExchangeStockProps(CPropExchange* pPX);
  461. BOOL IsConvertingVBX();
  462. DWORD SerializeVersion(CArchive& ar, DWORD dwVersionDefault,
  463. BOOL bConvert = TRUE);
  464. void SerializeExtent(CArchive& ar);
  465. void SerializeStockProps(CArchive& ar);
  466. void ResetVersion(DWORD dwVersionDefault);
  467. void ResetStockProps();
  468. // Stock methods
  469. void Refresh();
  470. void DoClick();
  471. // Stock properties
  472. short GetAppearance();
  473. void SetAppearance(short);
  474. OLE_COLOR GetBackColor();
  475. void SetBackColor(OLE_COLOR);
  476. short GetBorderStyle();
  477. void SetBorderStyle(short);
  478. BOOL GetEnabled();
  479. void SetEnabled(BOOL);
  480. CFontHolder& InternalGetFont();
  481. LPFONTDISP GetFont();
  482. void SetFont(LPFONTDISP);
  483. OLE_COLOR GetForeColor();
  484. void SetForeColor(OLE_COLOR);
  485. OLE_HANDLE GetHwnd();
  486. const CString& InternalGetText();
  487. BSTR GetText();
  488. void SetText(LPCTSTR);
  489. long GetReadyState();
  490. void InternalSetReadyState(long lNewReadyState);
  491. // Using colors
  492. COLORREF TranslateColor(OLE_COLOR clrColor, HPALETTE hpal = NULL);
  493. // Using fonts
  494. CFont* SelectStockFont(CDC* pDC);
  495. CFont* SelectFontObject(CDC* pDC, CFontHolder& fontHolder);
  496. void GetStockTextMetrics(LPTEXTMETRIC lptm);
  497. void GetFontTextMetrics(LPTEXTMETRIC lptm, CFontHolder& fontHolder);
  498. // Client site access
  499. LPOLECLIENTSITE GetClientSite();
  500. // Generic ambient property access
  501. BOOL GetAmbientProperty(DISPID dispid, VARTYPE vtProp, void* pvProp);
  502. BOOL WillAmbientsBeValidDuringLoad();
  503. // Specific ambient properties
  504. short AmbientAppearance();
  505. OLE_COLOR AmbientBackColor();
  506. CString AmbientDisplayName();
  507. LPFONTDISP AmbientFont();
  508. OLE_COLOR AmbientForeColor();
  509. LCID AmbientLocaleID();
  510. CString AmbientScaleUnits();
  511. short AmbientTextAlign();
  512. BOOL AmbientUserMode();
  513. BOOL AmbientUIDead();
  514. BOOL AmbientShowGrabHandles();
  515. BOOL AmbientShowHatching();
  516. // Firing events
  517. void AFX_CDECL FireEvent(DISPID dispid, BYTE* pbParams, ...);
  518. // Firing functions for stock events
  519. void FireKeyDown(USHORT* pnChar, short nShiftState);
  520. void FireKeyUp(USHORT* pnChar, short nShiftState);
  521. void FireKeyPress(USHORT* pnChar);
  522. void FireMouseDown(short nButton, short nShiftState,
  523. OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
  524. void FireMouseUp(short nButton, short nShiftState,
  525. OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
  526. void FireMouseMove(short nButton, short nShiftState,
  527. OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
  528. void FireClick();
  529. void FireDblClick();
  530. void FireError(SCODE scode, LPCTSTR lpszDescription, UINT nHelpID = 0);
  531. void FireReadyStateChange();
  532. // Changing size and/or rectangle
  533. BOOL GetRectInContainer(LPRECT lpRect);
  534. BOOL SetRectInContainer(LPCRECT lpRect);
  535. void GetControlSize(int* pcx, int* pcy);
  536. BOOL SetControlSize(int cx, int cy);
  537. // Window management
  538. void RecreateControlWindow();
  539. // Modal dialog operations
  540. void PreModalDialog(HWND hWndParent = NULL);
  541. void PostModalDialog(HWND hWndParent = NULL);
  542. // Data binding operations
  543. void BoundPropertyChanged(DISPID dispid);
  544. BOOL BoundPropertyRequestEdit(DISPID dispid);
  545. // Dispatch exceptions
  546. void ThrowError(SCODE sc, UINT nDescriptionID, UINT nHelpID = -1);
  547. void ThrowError(SCODE sc, LPCTSTR pszDescription = NULL, UINT nHelpID = 0);
  548. void GetNotSupported();
  549. void SetNotSupported();
  550. void SetNotPermitted();
  551. // Communication with the control site
  552. void ControlInfoChanged();
  553. BOOL LockInPlaceActive(BOOL bLock);
  554. LPDISPATCH GetExtendedControl();
  555. void TransformCoords(POINTL* lpptlHimetric,
  556. POINTF* lpptfContainer, DWORD flags);
  557. // Simple frame
  558. void EnableSimpleFrame();
  559. // Windowless operations
  560. CWnd* SetCapture();
  561. BOOL ReleaseCapture();
  562. CWnd* GetCapture();
  563. CWnd* SetFocus();
  564. CWnd* GetFocus();
  565. CDC* GetDC(LPCRECT lprcRect = NULL, DWORD dwFlags = OLEDC_PAINTBKGND);
  566. int ReleaseDC(CDC* pDC);
  567. void InvalidateRgn(CRgn* pRgn, BOOL bErase = TRUE);
  568. void ScrollWindow(int xAmount, int yAmount, LPCRECT lpRect = NULL,
  569. LPCRECT lpClipRect = NULL);
  570. BOOL ClipCaretRect(LPRECT lpRect);
  571. virtual void GetClientRect(LPRECT lpRect) const;
  572. // Overridables
  573. virtual void DoPropExchange(CPropExchange* pPX);
  574. virtual void OnResetState();
  575. virtual void OnDraw(
  576. CDC* pDC, const CRect& rcBounds, const CRect& rcInvalid);
  577. virtual void OnDrawMetafile(CDC* pDC, const CRect& rcBounds);
  578. // Class ID (implemented by IMPLEMENT_OLECREATE_EX macro)
  579. virtual HRESULT GetClassID(LPCLSID pclsid) = 0;
  580. // For customizing the default messages on the status bar
  581. virtual void GetMessageString(UINT nID, CString& rMessage) const;
  582. // Display of error events to user
  583. virtual void DisplayError(SCODE scode, LPCTSTR lpszDescription,
  584. LPCTSTR lpszSource, LPCTSTR lpszHelpFile, UINT nHelpID);
  585. // IOleObject notifications
  586. virtual void OnSetClientSite();
  587. virtual BOOL OnSetExtent(LPSIZEL lpSizeL);
  588. virtual void OnClose(DWORD dwSaveOption);
  589. // IOleInPlaceObject notifications
  590. virtual BOOL OnSetObjectRects(LPCRECT lpRectPos, LPCRECT lpRectClip);
  591. // Event connection point notifications
  592. virtual void OnEventAdvise(BOOL bAdvise);
  593. // Override to hook firing of Click event
  594. virtual void OnClick(USHORT iButton);
  595. // Override to get character after key events have been processed.
  596. virtual void OnKeyDownEvent(USHORT nChar, USHORT nShiftState);
  597. virtual void OnKeyUpEvent(USHORT nChar, USHORT nShiftState);
  598. virtual void OnKeyPressEvent(USHORT nChar);
  599. // Change notifications
  600. virtual void OnAppearanceChanged();
  601. virtual void OnBackColorChanged();
  602. virtual void OnBorderStyleChanged();
  603. virtual void OnEnabledChanged();
  604. virtual void OnTextChanged();
  605. virtual void OnFontChanged();
  606. virtual void OnForeColorChanged();
  607. // IOleControl notifications
  608. virtual void OnGetControlInfo(LPCONTROLINFO pControlInfo);
  609. virtual void OnMnemonic(LPMSG pMsg);
  610. virtual void OnAmbientPropertyChange(DISPID dispid);
  611. virtual void OnFreezeEvents(BOOL bFreeze);
  612. // In-place activation
  613. virtual HMENU OnGetInPlaceMenu();
  614. virtual void OnShowToolBars();
  615. virtual void OnHideToolBars();
  616. // IViewObject
  617. virtual BOOL OnGetColorSet(DVTARGETDEVICE* ptd, HDC hicTargetDev,
  618. LPLOGPALETTE* ppColorSet);
  619. virtual BOOL OnGetViewExtent(DWORD dwDrawAspect, LONG lindex,
  620. DVTARGETDEVICE* ptd, LPSIZEL lpsizel);
  621. virtual BOOL OnGetViewRect(DWORD dwAspect, LPRECTL pRect);
  622. virtual DWORD OnGetViewStatus();
  623. virtual BOOL OnQueryHitPoint(DWORD dwAspect, LPCRECT pRectBounds,
  624. POINT ptlLoc, LONG lCloseHint, DWORD* pHitResult);
  625. virtual BOOL OnQueryHitRect(DWORD dwAspect, LPCRECT pRectBounds,
  626. LPCRECT prcLoc, LONG lCloseHint, DWORD* pHitResult);
  627. virtual BOOL OnGetNaturalExtent(DWORD dwAspect, LONG lindex,
  628. DVTARGETDEVICE* ptd, HDC hicTargetDev, DVEXTENTINFO* pExtentInfo,
  629. LPSIZEL psizel);
  630. // IDataObject - see COleDataSource for a description of these overridables
  631. virtual BOOL OnRenderGlobalData(LPFORMATETC lpFormatEtc, HGLOBAL* phGlobal);
  632. virtual BOOL OnRenderFileData(LPFORMATETC lpFormatEtc, CFile* pFile);
  633. virtual BOOL OnRenderData(LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium);
  634. virtual BOOL OnSetData(LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium,
  635. BOOL bRelease);
  636. // Verbs
  637. virtual BOOL OnEnumVerbs(LPENUMOLEVERB* ppenumOleVerb);
  638. virtual BOOL OnDoVerb(LONG iVerb, LPMSG lpMsg, HWND hWndParent, LPCRECT lpRect);
  639. virtual BOOL OnEdit(LPMSG lpMsg, HWND hWndParent, LPCRECT lpRect);
  640. virtual BOOL OnProperties(LPMSG lpMsg, HWND hWndParent, LPCRECT lpRect);
  641. // IPerPropertyBrowsing overrides
  642. virtual BOOL OnGetDisplayString(DISPID dispid, CString& strValue);
  643. virtual BOOL OnMapPropertyToPage(DISPID dispid, LPCLSID lpclsid,
  644. BOOL* pbPageOptional);
  645. virtual BOOL OnGetPredefinedStrings(DISPID dispid,
  646. CStringArray* pStringArray, CDWordArray* pCookieArray);
  647. virtual BOOL OnGetPredefinedValue(DISPID dispid, DWORD dwCookie,
  648. VARIANT* lpvarOut);
  649. // Subclassing
  650. virtual BOOL IsSubclassedControl();
  651. // Window reparenting
  652. virtual void ReparentControlWindow(HWND hWndOuter, HWND hWndParent);
  653. // Window procedure
  654. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  655. // General-purpose flags
  656. enum ControlFlags {
  657. fastBeginPaint = 0x0001,
  658. clipPaintDC = 0x0002,
  659. pointerInactive = 0x0004,
  660. noFlickerActivate = 0x0008,
  661. windowlessActivate = 0x0010,
  662. canOptimizeDraw = 0x0020,
  663. };
  664. virtual DWORD GetControlFlags();
  665. // Inactive pointer handling
  666. virtual DWORD GetActivationPolicy();
  667. virtual BOOL OnInactiveSetCursor(LPCRECT lprcBounds, long x, long y,
  668. DWORD dwMouseMsg, BOOL bSetAlways);
  669. virtual void OnInactiveMouseMove(LPCRECT lprcBounds, long x, long y,
  670. DWORD dwKeyState);
  671. // Windowless activation handling
  672. virtual BOOL OnWindowlessMessage(UINT msg, WPARAM wParam, LPARAM lParam,
  673. LRESULT* plResult);
  674. virtual IDropTarget* GetWindowlessDropTarget();
  675. // Inactive/windowless helper functions
  676. virtual void GetClientOffset(long* pdxOffset, long* pdyOffset) const;
  677. virtual UINT ParentToClient(LPCRECT lprcBounds, LPPOINT pPoint,
  678. BOOL bHitTest = FALSE) const;
  679. virtual void ClientToParent(LPCRECT lprcBounds, LPPOINT pPoint) const;
  680. // Asynchronous properties
  681. void Load(LPCTSTR strNewPath, CDataPathProperty& prop);
  682. // Implementation
  683. public:
  684. ~COleControl();
  685. void RequestAsynchronousExchange(DWORD dwVersion);
  686. #ifdef _DEBUG
  687. void AssertValid() const;
  688. void Dump(CDumpContext& dc) const;
  689. #endif // _DEBUG
  690. protected:
  691. // Friend classes
  692. friend class COleControlInnerUnknown;
  693. friend class CReflectorWnd;
  694. friend class CControlFrameWnd;
  695. // Interface hook for primary automation interface
  696. LPUNKNOWN GetInterfaceHook(const void* piid);
  697. // Shutdown
  698. virtual void OnFinalRelease();
  699. #if _MFC_VER >= 0x0600
  700. void ReleaseCaches();
  701. #endif
  702. // Window management
  703. virtual BOOL CreateControlWindow(HWND hWndParent, const CRect& rcPos,
  704. LPCRECT prcClipped = NULL);
  705. void CreateWindowForSubclassedControl();
  706. BOOL IgnoreWindowMessage(UINT msg, WPARAM wParam, LPARAM lParam,
  707. LRESULT* plResult);
  708. virtual LRESULT DefWindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam);
  709. // Serialization
  710. HRESULT SaveState(IStream* pStm);
  711. HRESULT LoadState(IStream* pStm);
  712. virtual void Serialize(CArchive& ar);
  713. // Drawing
  714. void DrawContent(CDC* pDC, CRect& rc);
  715. void DrawMetafile(CDC* pDC, CRect& rc);
  716. BOOL GetMetafileData(LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium);
  717. // Implementation of IDataObject
  718. // CControlDataSource implements OnRender reflections to COleControl
  719. class CControlDataSource : public COleDataSource
  720. {
  721. public:
  722. CControlDataSource(COleControl* pCtrl);
  723. protected:
  724. virtual BOOL OnRenderGlobalData(LPFORMATETC lpFormatEtc, HGLOBAL* phGlobal);
  725. virtual BOOL OnRenderFileData(LPFORMATETC lpFormatEtc, CFile* pFile);
  726. virtual BOOL OnRenderData(LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium);
  727. virtual BOOL OnSetData(LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium,
  728. BOOL bRelease);
  729. COleControl* m_pCtrl;
  730. };
  731. friend class CControlDataSource;
  732. // IDataObject formats
  733. CControlDataSource* GetDataSource();
  734. virtual void SetInitialDataFormats();
  735. BOOL GetPropsetData(LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium,
  736. REFCLSID fmtid);
  737. BOOL SetPropsetData(LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium,
  738. REFCLSID fmtid);
  739. // Type library
  740. BOOL GetDispatchIID(IID* pIID);
  741. // Connection point container
  742. virtual LPCONNECTIONPOINT GetConnectionHook(REFIID iid);
  743. virtual BOOL GetExtraConnectionPoints(CPtrArray* pConnPoints);
  744. // Events
  745. static const AFX_DATA AFX_EVENTMAP_ENTRY _eventEntries[];
  746. virtual const AFX_EVENTMAP* GetEventMap() const;
  747. static const AFX_DATA AFX_EVENTMAP eventMap;
  748. const AFX_EVENTMAP_ENTRY* GetEventMapEntry(LPCTSTR pszName,
  749. DISPID* pDispid) const;
  750. void FireEventV(DISPID dispid, BYTE* pbParams, va_list argList);
  751. // Stock events
  752. void KeyDown(USHORT* pnChar);
  753. void KeyUp(USHORT* pnChar);
  754. void ButtonDown(USHORT iButton, UINT nFlags, CPoint point);
  755. void ButtonUp(USHORT iButton, UINT nFlags, CPoint point);
  756. void ButtonDblClk(USHORT iButton, UINT nFlags, CPoint point);
  757. // Masks to identify which stock events and properties are used
  758. void InitStockEventMask();
  759. void InitStockPropMask();
  760. DWORD GetStockEventMask() const;
  761. DWORD GetStockPropMask() const;
  762. // Support for subclassing a Windows control
  763. CWnd* GetOuterWindow() const; // m_pReflect if any, otherwise this
  764. virtual void OnReflectorDestroyed();
  765. // Aggregation of default handler
  766. virtual BOOL OnCreateAggregates();
  767. LPVOID QueryDefHandler(REFIID iid);
  768. // State change notifications
  769. void SendAdvise(UINT uCode);
  770. // Non-in-place activation
  771. virtual HRESULT OnOpen(BOOL bTryInPlace, LPMSG pMsg);
  772. #if defined(_AFXDLL) || _MFC_VER < 0x0600
  773. void ResizeOpenControl(int cx, int cy);
  774. virtual CControlFrameWnd* CreateFrameWindow();
  775. virtual void ResizeFrameWindow(int cx, int cy);
  776. virtual void OnFrameClose();
  777. #endif
  778. virtual HRESULT OnHide();
  779. // In-place activation
  780. virtual HRESULT OnActivateInPlace(BOOL bUIActivate, LPMSG pMsg);
  781. void ForwardActivationMsg(LPMSG pMsg);
  782. virtual void AddFrameLevelUI();
  783. virtual void RemoveFrameLevelUI();
  784. virtual BOOL BuildSharedMenu();
  785. virtual void DestroySharedMenu();
  786. // Property sheet
  787. virtual LPCLSID GetPropPageIDs(ULONG& cPropPages);
  788. // IOleObject implementation
  789. void GetUserType(LPTSTR pszUserType);
  790. virtual UINT GetUserTypeNameID() = 0;
  791. virtual DWORD GetMiscStatus() = 0;
  792. // Rectangle tracker
  793. void CreateTracker(BOOL bHandles, BOOL bHatching);
  794. #if _MFC_VER >= 0x0600
  795. void CreateTracker(BOOL bHandles, BOOL bHatching, LPCRECT prcClip);
  796. #endif
  797. void DestroyTracker();
  798. // Automation
  799. BOOL IsInvokeAllowed(DISPID dispid);
  800. // Ambient property interface initialization
  801. COleDispatchDriver* GetAmbientDispatchDriver();
  802. // Data members
  803. const IID* m_piidPrimary; // IID for control automation
  804. const IID* m_piidEvents; // IID for control events
  805. DWORD m_dwVersionLoaded; // Version number of loaded state
  806. COleDispatchDriver m_ambientDispDriver; // Driver for ambient properties
  807. ULONG m_cEventsFrozen; // Event freeze count (>0 means frozen)
  808. union
  809. {
  810. #if _MFC_VER >= 0x0600
  811. #ifdef _AFXDLL
  812. CControlFrameWnd* m_pWndOpenFrame; // Open frame window.
  813. #endif
  814. CControlRectTracker* m_pRectTracker; // Tracker for UI active control
  815. #else
  816. CControlFrameWnd* m_pWndOpenFrame; // Open frame window.
  817. CRectTracker* m_pRectTracker; // Tracker for UI active control
  818. #endif
  819. };
  820. CRect m_rcPos; // Control's position rectangle
  821. CRect m_rcBounds; // Bounding rectangle for drawing
  822. CPoint m_ptOffset; // Child window origin
  823. long m_cxExtent; // Control's width in HIMETRIC units
  824. long m_cyExtent; // Control's height in HIMETRIC units
  825. class CReflectorWnd* m_pReflect; // Reflector window
  826. UINT m_nIDTracking; // Tracking command ID or string IDS
  827. UINT m_nIDLastMessage; // Last displayed message string IDS
  828. unsigned m_bAutoMenuEnable : 1; // Disable menu items without handlers?
  829. unsigned m_bFinalReleaseCalled : 1; // Are we handling the final Release?
  830. unsigned m_bModified : 1; // "Dirty" bit.
  831. unsigned m_bCountOnAmbients : 1; // Can we count on Ambients during load?
  832. unsigned m_iButtonState : 3; // Which buttons are down?
  833. unsigned m_iDblClkState : 3; // Which buttons involved in dbl click?
  834. unsigned m_bInPlaceActive : 1; // Are we in-place active?
  835. unsigned m_bUIActive : 1; // Are we UI active?
  836. unsigned m_bPendingUIActivation : 1; // Are we about to become UI active?
  837. #if defined(_AFXDLL) || _MFC_VER < 0x0600
  838. unsigned m_bOpen : 1; // Are we open (non-in-place)?
  839. #endif
  840. unsigned m_bChangingExtent : 1; // Extent is currently being changed
  841. unsigned m_bConvertVBX : 1; // VBX conversion in progress
  842. unsigned m_bSimpleFrame : 1; // Simple frame support
  843. unsigned m_bUIDead : 1; // UIDead ambient property value
  844. unsigned m_bInitialized : 1; // Was IPersist*::{InitNew,Load} called?
  845. unsigned m_bAutoClip : 1; // Does container automatically clip?
  846. unsigned m_bMsgReflect : 1; // Does container reflect messages?
  847. unsigned m_bInPlaceSiteEx : 1; // Extended in-place site?
  848. unsigned m_bInPlaceSiteWndless : 1; // Windowless in-place site?
  849. unsigned m_bNoRedraw : 1; // Should we skip OnPaint this time?
  850. unsigned m_bOptimizedDraw : 1; // Is optimized drawing possible?
  851. // Stock properties
  852. OLE_COLOR m_clrBackColor; // BackColor
  853. OLE_COLOR m_clrForeColor; // ForeColor
  854. CString m_strText; // Text/Caption
  855. CFontHolder m_font; // Font
  856. HFONT m_hFontPrev; // Previously selected font object
  857. short m_sAppearance; // Appearance
  858. short m_sBorderStyle; // BorderStyle
  859. BOOL m_bEnabled; // Enabled
  860. long m_lReadyState; // ReadyState
  861. // UI Active info (shared OLE menu data)
  862. _AFXCTL_UIACTIVE_INFO* m_pUIActiveInfo;
  863. // Default Handler aggregation
  864. LPUNKNOWN m_pDefIUnknown;
  865. _AFXCTL_ADVISE_INFO* m_pAdviseInfo;
  866. LPPERSISTSTORAGE m_pDefIPersistStorage;
  867. LPVIEWOBJECT m_pDefIViewObject;
  868. LPOLECACHE m_pDefIOleCache;
  869. // OLE client site interfaces
  870. LPOLECLIENTSITE m_pClientSite; // Client site
  871. union
  872. {
  873. LPOLEINPLACESITE m_pInPlaceSite; // In-place site
  874. LPOLEINPLACESITEEX m_pInPlaceSiteEx;
  875. LPOLEINPLACESITEWINDOWLESS m_pInPlaceSiteWndless;
  876. };
  877. LPOLECONTROLSITE m_pControlSite; // Control site
  878. LPOLEADVISEHOLDER m_pOleAdviseHolder; // Advise holder
  879. LPDATAADVISEHOLDER m_pDataAdviseHolder; // Data advise holder
  880. LPSIMPLEFRAMESITE m_pSimpleFrameSite; // Simple frame site
  881. // OLE in-place activation info
  882. LPOLEINPLACEFRAME m_pInPlaceFrame;
  883. OLEINPLACEFRAMEINFO m_frameInfo;
  884. LPOLEINPLACEUIWINDOW m_pInPlaceDoc;
  885. // OLE data source
  886. CControlDataSource* m_pDataSource;
  887. // OLE data path load data
  888. BOOL m_bDataPathPropertiesLoaded;
  889. DWORD m_dwDataPathVersionToReport;
  890. // Message Maps
  891. protected:
  892. //{{AFX_MSG(COleControl)
  893. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  894. afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
  895. afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
  896. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  897. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  898. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  899. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  900. afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
  901. afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
  902. afx_msg void OnMButtonDblClk(UINT nFlags, CPoint point);
  903. afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  904. afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
  905. afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point);
  906. afx_msg void OnInitMenuPopup(CMenu*, UINT, BOOL);
  907. afx_msg void OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu);
  908. afx_msg LRESULT OnSetMessageString(WPARAM wParam, LPARAM lParam);
  909. afx_msg void OnEnterIdle(UINT nWhy, CWnd* pWho);
  910. afx_msg void OnCancelMode();
  911. afx_msg void OnPaint(CDC* pDC);
  912. #if _MFC_VER >= 0x0600
  913. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  914. #endif
  915. afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  916. afx_msg void OnSysKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
  917. afx_msg int OnMouseActivate(CWnd *pDesktopWnd, UINT nHitTest, UINT message);
  918. afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam);
  919. afx_msg BOOL OnNcCreate(LPCREATESTRUCT lpCreateStruct);
  920. afx_msg void OnDestroy();
  921. afx_msg void OnKillFocus(CWnd* pNewWnd);
  922. afx_msg void OnSetFocus(CWnd* pOldWnd);
  923. afx_msg void OnNcPaint();
  924. afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp);
  925. afx_msg UINT OnNcHitTest(CPoint point);
  926. afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
  927. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  928. afx_msg UINT OnGetDlgCode();
  929. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  930. afx_msg void OnSize(UINT nType, int cx, int cy);
  931. afx_msg void OnMove(int x, int y);
  932. afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
  933. //}}AFX_MSG
  934. afx_msg LRESULT OnOcmCtlColorBtn(WPARAM wParam, LPARAM lParam);
  935. afx_msg LRESULT OnOcmCtlColorDlg(WPARAM wParam, LPARAM lParam);
  936. afx_msg LRESULT OnOcmCtlColorEdit(WPARAM wParam, LPARAM lParam);
  937. afx_msg LRESULT OnOcmCtlColorListBox(WPARAM wParam, LPARAM lParam);
  938. afx_msg LRESULT OnOcmCtlColorMsgBox(WPARAM wParam, LPARAM lParam);
  939. afx_msg LRESULT OnOcmCtlColorScrollBar(WPARAM wParam, LPARAM lParam);
  940. afx_msg LRESULT OnOcmCtlColorStatic(WPARAM wParam, LPARAM lParam);
  941. DECLARE_MESSAGE_MAP()
  942. #if _MFC_VER >= 0x0600
  943. // button handler helpers
  944. void OnButtonUp(USHORT nButton, UINT nFlags, CPoint point);
  945. void OnButtonDown(USHORT nButton, UINT nFlags, CPoint point);
  946. void OnButtonDblClk(USHORT nButton, UINT nFlags, CPoint point);
  947. #endif
  948. // Interface Maps
  949. public:
  950. // IPersistStorage
  951. BEGIN_INTERFACE_PART(PersistStorage, IPersistStorage)
  952. INIT_INTERFACE_PART(COleControl, PersistStorage)
  953. STDMETHOD(GetClassID)(LPCLSID);
  954. STDMETHOD(IsDirty)();
  955. STDMETHOD(InitNew)(LPSTORAGE);
  956. STDMETHOD(Load)(LPSTORAGE);
  957. STDMETHOD(Save)(LPSTORAGE, BOOL);
  958. STDMETHOD(SaveCompleted)(LPSTORAGE);
  959. STDMETHOD(HandsOffStorage)();
  960. #if _MFC_VER >= 0x0600
  961. END_INTERFACE_PART_STATIC(PersistStorage)
  962. #else
  963. END_INTERFACE_PART(PersistStorage)
  964. #endif
  965. // IPersistStreamInit
  966. BEGIN_INTERFACE_PART(PersistStreamInit, IPersistStreamInit)
  967. INIT_INTERFACE_PART(COleControl, PersistStreamInit)
  968. STDMETHOD(GetClassID)(LPCLSID);
  969. STDMETHOD(IsDirty)();
  970. STDMETHOD(Load)(LPSTREAM);
  971. STDMETHOD(Save)(LPSTREAM, BOOL);
  972. STDMETHOD(GetSizeMax)(ULARGE_INTEGER *);
  973. STDMETHOD(InitNew)();
  974. #if _MFC_VER >= 0x0600
  975. END_INTERFACE_PART_STATIC(PersistStreamInit)
  976. #else
  977. END_INTERFACE_PART(PersistStreamInit)
  978. #endif
  979. // IPersistMemory
  980. BEGIN_INTERFACE_PART(PersistMemory, IPersistMemory)
  981. INIT_INTERFACE_PART(COleControl, PersistMemory)
  982. STDMETHOD(GetClassID)(LPCLSID);
  983. STDMETHOD(IsDirty)();
  984. STDMETHOD(Load)(LPVOID, ULONG);
  985. STDMETHOD(Save)(LPVOID, BOOL, ULONG);
  986. STDMETHOD(GetSizeMax)(ULONG*);
  987. STDMETHOD(InitNew)();
  988. #if _MFC_VER >= 0x0600
  989. END_INTERFACE_PART_STATIC(PersistMemory)
  990. #else
  991. END_INTERFACE_PART(PersistMemory)
  992. #endif
  993. // IPersistPropertyBag
  994. BEGIN_INTERFACE_PART(PersistPropertyBag, IPersistPropertyBag)
  995. INIT_INTERFACE_PART(COleControl, PersistPropertyBag)
  996. STDMETHOD(GetClassID)(LPCLSID);
  997. STDMETHOD(InitNew)();
  998. STDMETHOD(Load)(LPPROPERTYBAG, LPERRORLOG);
  999. STDMETHOD(Save)(LPPROPERTYBAG, BOOL, BOOL);
  1000. #if _MFC_VER >= 0x0600
  1001. END_INTERFACE_PART_STATIC(PersistPropertyBag)
  1002. #else
  1003. END_INTERFACE_PART(PersistPropertyBag)
  1004. #endif
  1005. // IOleObject
  1006. BEGIN_INTERFACE_PART(OleObject, IOleObject)
  1007. INIT_INTERFACE_PART(COleControl, OleObject)
  1008. STDMETHOD(SetClientSite)(LPOLECLIENTSITE);
  1009. STDMETHOD(GetClientSite)(LPOLECLIENTSITE*);
  1010. STDMETHOD(SetHostNames)(LPCOLESTR, LPCOLESTR);
  1011. STDMETHOD(Close)(DWORD);
  1012. STDMETHOD(SetMoniker)(DWORD, LPMONIKER);
  1013. STDMETHOD(GetMoniker)(DWORD, DWORD, LPMONIKER*);
  1014. STDMETHOD(InitFromData)(LPDATAOBJECT, BOOL, DWORD);
  1015. STDMETHOD(GetClipboardData)(DWORD, LPDATAOBJECT*);
  1016. STDMETHOD(DoVerb)(LONG, LPMSG, LPOLECLIENTSITE, LONG, HWND, LPCRECT);
  1017. STDMETHOD(EnumVerbs)(IEnumOLEVERB**);
  1018. STDMETHOD(Update)();
  1019. STDMETHOD(IsUpToDate)();
  1020. STDMETHOD(GetUserClassID)(CLSID*);
  1021. STDMETHOD(GetUserType)(DWORD, LPOLESTR*);
  1022. STDMETHOD(SetExtent)(DWORD, LPSIZEL);
  1023. STDMETHOD(GetExtent)(DWORD, LPSIZEL);
  1024. STDMETHOD(Advise)(LPADVISESINK, LPDWORD);
  1025. STDMETHOD(Unadvise)(DWORD);
  1026. STDMETHOD(EnumAdvise)(LPENUMSTATDATA*);
  1027. STDMETHOD(GetMiscStatus)(DWORD, LPDWORD);
  1028. STDMETHOD(SetColorScheme)(LPLOGPALETTE);
  1029. END_INTERFACE_PART(OleObject)
  1030. // IViewObjectEx
  1031. BEGIN_INTERFACE_PART(ViewObject, IViewObjectEx)
  1032. INIT_INTERFACE_PART(COleControl, ViewObject)
  1033. STDMETHOD(Draw)(DWORD, LONG, void*, DVTARGETDEVICE*, HDC, HDC,
  1034. LPCRECTL, LPCRECTL, BOOL (CALLBACK*)(DWORD_PTR), DWORD_PTR);
  1035. STDMETHOD(GetColorSet)(DWORD, LONG, void*, DVTARGETDEVICE*,
  1036. HDC, LPLOGPALETTE*);
  1037. STDMETHOD(Freeze)(DWORD, LONG, void*, DWORD*);
  1038. STDMETHOD(Unfreeze)(DWORD);
  1039. STDMETHOD(SetAdvise)(DWORD, DWORD, LPADVISESINK);
  1040. STDMETHOD(GetAdvise)(DWORD*, DWORD*, LPADVISESINK*);
  1041. STDMETHOD(GetExtent) (DWORD, LONG, DVTARGETDEVICE*, LPSIZEL);
  1042. STDMETHOD(GetRect)(DWORD, LPRECTL);
  1043. STDMETHOD(GetViewStatus)(DWORD*);
  1044. STDMETHOD(QueryHitPoint)(DWORD, LPCRECT, POINT, LONG, DWORD*);
  1045. STDMETHOD(QueryHitRect)(DWORD, LPCRECT, LPCRECT, LONG, DWORD*);
  1046. STDMETHOD(GetNaturalExtent)(DWORD, LONG, DVTARGETDEVICE*, HDC,
  1047. DVEXTENTINFO*, LPSIZEL);
  1048. END_INTERFACE_PART(ViewObject)
  1049. // IDataObject
  1050. BEGIN_INTERFACE_PART(DataObject, IDataObject)
  1051. INIT_INTERFACE_PART(COleControl, DataObject)
  1052. STDMETHOD(GetData)(LPFORMATETC, LPSTGMEDIUM);
  1053. STDMETHOD(GetDataHere)(LPFORMATETC, LPSTGMEDIUM);
  1054. STDMETHOD(QueryGetData)(LPFORMATETC);
  1055. STDMETHOD(GetCanonicalFormatEtc)(LPFORMATETC, LPFORMATETC);
  1056. STDMETHOD(SetData)(LPFORMATETC, LPSTGMEDIUM, BOOL);
  1057. STDMETHOD(EnumFormatEtc)(DWORD, LPENUMFORMATETC*);
  1058. STDMETHOD(DAdvise)(LPFORMATETC, DWORD, LPADVISESINK, LPDWORD);
  1059. STDMETHOD(DUnadvise)(DWORD);
  1060. STDMETHOD(EnumDAdvise)(LPENUMSTATDATA*);
  1061. #if _MFC_VER >= 0x0600
  1062. END_INTERFACE_PART_STATIC(DataObject)
  1063. #else
  1064. END_INTERFACE_PART(DataObject)
  1065. #endif
  1066. // IOleInPlaceObject
  1067. BEGIN_INTERFACE_PART(OleInPlaceObject, IOleInPlaceObjectWindowless)
  1068. INIT_INTERFACE_PART(COleControl, OleInPlaceObject)
  1069. STDMETHOD(GetWindow)(HWND*);
  1070. STDMETHOD(ContextSensitiveHelp)(BOOL);
  1071. STDMETHOD(InPlaceDeactivate)();
  1072. STDMETHOD(UIDeactivate)();
  1073. STDMETHOD(SetObjectRects)(LPCRECT, LPCRECT);
  1074. STDMETHOD(ReactivateAndUndo)();
  1075. STDMETHOD(OnWindowMessage)(UINT msg, WPARAM wParam, LPARAM lparam,
  1076. LRESULT* plResult);
  1077. STDMETHOD(GetDropTarget)(IDropTarget **ppDropTarget);
  1078. END_INTERFACE_PART(OleInPlaceObject)
  1079. // IOleInPlaceActiveObject
  1080. BEGIN_INTERFACE_PART(OleInPlaceActiveObject, IOleInPlaceActiveObject)
  1081. INIT_INTERFACE_PART(COleControl, OleInPlaceActiveObject)
  1082. STDMETHOD(GetWindow)(HWND*);
  1083. STDMETHOD(ContextSensitiveHelp)(BOOL);
  1084. STDMETHOD(TranslateAccelerator)(LPMSG);
  1085. STDMETHOD(OnFrameWindowActivate)(BOOL);
  1086. STDMETHOD(OnDocWindowActivate)(BOOL);
  1087. STDMETHOD(ResizeBorder)(LPCRECT, LPOLEINPLACEUIWINDOW, BOOL);
  1088. STDMETHOD(EnableModeless)(BOOL);
  1089. END_INTERFACE_PART(OleInPlaceActiveObject)
  1090. // IOleCache
  1091. BEGIN_INTERFACE_PART(OleCache, IOleCache)
  1092. INIT_INTERFACE_PART(COleControl, OleCache)
  1093. STDMETHOD(Cache)(LPFORMATETC, DWORD, LPDWORD);
  1094. STDMETHOD(Uncache)(DWORD);
  1095. STDMETHOD(EnumCache)(LPENUMSTATDATA*);
  1096. STDMETHOD(InitCache)(LPDATAOBJECT);
  1097. STDMETHOD(SetData)(LPFORMATETC, STGMEDIUM*, BOOL);
  1098. #if _MFC_VER >= 0x0600
  1099. END_INTERFACE_PART_STATIC(OleCache)
  1100. #else
  1101. END_INTERFACE_PART(OleCache)
  1102. #endif
  1103. // IOleControl
  1104. BEGIN_INTERFACE_PART(OleControl, IOleControl)
  1105. INIT_INTERFACE_PART(COleControl, OleControl)
  1106. STDMETHOD(GetControlInfo)(LPCONTROLINFO pCI);
  1107. STDMETHOD(OnMnemonic)(LPMSG pMsg);
  1108. STDMETHOD(OnAmbientPropertyChange)(DISPID dispid);
  1109. STDMETHOD(FreezeEvents)(BOOL bFreeze);
  1110. END_INTERFACE_PART(OleControl)
  1111. // IProvideClassInfo2
  1112. BEGIN_INTERFACE_PART(ProvideClassInfo, IProvideClassInfo2)
  1113. INIT_INTERFACE_PART(COleControl, ProvideClassInfo)
  1114. STDMETHOD(GetClassInfo)(LPTYPEINFO* ppTypeInfo);
  1115. STDMETHOD(GetGUID)(DWORD dwGuidKind, GUID* pGUID);
  1116. #if _MFC_VER >= 0x0600
  1117. END_INTERFACE_PART_STATIC(ProvideClassInfo)
  1118. #else
  1119. END_INTERFACE_PART(ProvideClassInfo)
  1120. #endif
  1121. // ISpecifyPropertyPages
  1122. BEGIN_INTERFACE_PART(SpecifyPropertyPages, ISpecifyPropertyPages)
  1123. INIT_INTERFACE_PART(COleControl, SpecifyPropertyPages)
  1124. STDMETHOD(GetPages)(CAUUID*);
  1125. #if _MFC_VER >= 0x0600
  1126. END_INTERFACE_PART_STATIC(SpecifyPropertyPages)
  1127. #else
  1128. END_INTERFACE_PART(SpecifyPropertyPages)
  1129. #endif
  1130. // IPerPropertyBrowsing
  1131. BEGIN_INTERFACE_PART(PerPropertyBrowsing, IPerPropertyBrowsing)
  1132. INIT_INTERFACE_PART(COleControl, PerPropertyBrowsing)
  1133. STDMETHOD(GetDisplayString)(DISPID dispid, BSTR* lpbstr);
  1134. STDMETHOD(MapPropertyToPage)(DISPID dispid, LPCLSID lpclsid);
  1135. STDMETHOD(GetPredefinedStrings)(DISPID dispid,
  1136. CALPOLESTR* lpcaStringsOut, CADWORD* lpcaCookiesOut);
  1137. STDMETHOD(GetPredefinedValue)(DISPID dispid, DWORD dwCookie,
  1138. VARIANT* lpvarOut);
  1139. #if _MFC_VER >= 0x0600
  1140. END_INTERFACE_PART_STATIC(PerPropertyBrowsing)
  1141. #else
  1142. END_INTERFACE_PART(PerPropertyBrowsing)
  1143. #endif
  1144. // IPropertyNotifySink for font updates (not exposed via QueryInterface)
  1145. BEGIN_INTERFACE_PART(FontNotification, IPropertyNotifySink)
  1146. INIT_INTERFACE_PART(COleControl, FontNotification)
  1147. STDMETHOD(OnChanged)(DISPID dispid);
  1148. STDMETHOD(OnRequestEdit)(DISPID dispid);
  1149. #if _MFC_VER >= 0x0600
  1150. END_INTERFACE_PART_STATIC(FontNotification)
  1151. #else
  1152. END_INTERFACE_PART(FontNotification)
  1153. #endif
  1154. // IQuickActivate
  1155. BEGIN_INTERFACE_PART(QuickActivate, IQuickActivate)
  1156. STDMETHOD(QuickActivate)(QACONTAINER *pQAContainer, QACONTROL *pqacontrol);
  1157. STDMETHOD(SetContentExtent)(LPSIZEL lpsizel);
  1158. STDMETHOD(GetContentExtent)(LPSIZEL lpsizel);
  1159. #if _MFC_VER >= 0x0600
  1160. END_INTERFACE_PART_STATIC(QuickActivate)
  1161. #else
  1162. END_INTERFACE_PART(QuickActivate)
  1163. #endif
  1164. // IPointerInactive
  1165. BEGIN_INTERFACE_PART(PointerInactive, IPointerInactive)
  1166. STDMETHOD(GetActivationPolicy)(DWORD* pdwPolicy);
  1167. STDMETHOD(OnInactiveSetCursor)(LPCRECT lprcBounds, long x, long y,
  1168. DWORD dwMouseMsg, BOOL bSetAlways);
  1169. STDMETHOD(OnInactiveMouseMove)(LPCRECT lprcBounds, long x, long y,
  1170. DWORD dwKeyState);
  1171. #if _MFC_VER >= 0x0600
  1172. END_INTERFACE_PART_STATIC(PointerInactive)
  1173. #else
  1174. END_INTERFACE_PART(PointerInactive)
  1175. #endif
  1176. DECLARE_INTERFACE_MAP()
  1177. // Connection maps
  1178. protected:
  1179. // Connection point for events
  1180. BEGIN_CONNECTION_PART(COleControl, EventConnPt)
  1181. virtual void OnAdvise(BOOL bAdvise);
  1182. virtual REFIID GetIID();
  1183. virtual LPUNKNOWN QuerySinkInterface(LPUNKNOWN pUnkSink);
  1184. END_CONNECTION_PART(EventConnPt)
  1185. // Connection point for property notifications
  1186. BEGIN_CONNECTION_PART(COleControl, PropConnPt)
  1187. CONNECTION_IID(IID_IPropertyNotifySink)
  1188. END_CONNECTION_PART(PropConnPt)
  1189. DECLARE_CONNECTION_MAP()
  1190. };
  1191. /////////////////////////////////////////////////////////////////////////////
  1192. // Registry functions
  1193. enum AFX_REG_FLAGS
  1194. {
  1195. afxRegDefault = 0x0000,
  1196. afxRegInsertable = 0x0001,
  1197. afxRegApartmentThreading = 0x0002,
  1198. };
  1199. BOOL AFXAPI AfxOleRegisterTypeLib(HINSTANCE hInstance, REFGUID tlid,
  1200. LPCTSTR pszFileName = NULL, LPCTSTR pszHelpDir = NULL);
  1201. BOOL AFXAPI AfxOleUnregisterTypeLib(REFGUID tlid, WORD wVerMajor = 0,
  1202. WORD wVerMinor = 0, LCID lcid = 0);
  1203. BOOL AFXAPI AfxOleRegisterControlClass(HINSTANCE hInstance, REFCLSID clsid,
  1204. LPCTSTR pszProgID, UINT idTypeName, UINT idBitmap, int nRegFlags,
  1205. DWORD dwMiscStatus, REFGUID tlid, WORD wVerMajor, WORD wVerMinor);
  1206. BOOL AFXAPI AfxOleUnregisterClass(REFCLSID clsid, LPCTSTR pszProgID);
  1207. BOOL AFXAPI AfxOleRegisterPropertyPageClass(HINSTANCE hInstance,
  1208. REFCLSID clsid, UINT idTypeName);
  1209. BOOL AFXAPI AfxOleRegisterPropertyPageClass(HINSTANCE hInstance,
  1210. REFCLSID clsid, UINT idTypeName, int nRegFlags);
  1211. /////////////////////////////////////////////////////////////////////////////
  1212. // Licensing functions
  1213. BOOL AFXAPI AfxVerifyLicFile(HINSTANCE hInstance, LPCTSTR pszLicFileName,
  1214. LPCOLESTR pszLicFileContents, UINT cch=-1);
  1215. /////////////////////////////////////////////////////////////////////////////
  1216. // CPropExchange - Abstract base class for property exchange
  1217. #ifdef _AFXDLL
  1218. class CPropExchange
  1219. #else
  1220. class AFX_NOVTABLE CPropExchange
  1221. #endif
  1222. {
  1223. // Operations
  1224. public:
  1225. BOOL IsLoading();
  1226. DWORD GetVersion();
  1227. BOOL IsAsynchronous();
  1228. // FALSE -> Do Sync stuff, and start async stuff if possible
  1229. // TRUE -> Do not do Sync stuff. Always start Async stuff
  1230. virtual BOOL ExchangeVersion(DWORD& dwVersionLoaded, DWORD dwVersionDefault,
  1231. BOOL bConvert);
  1232. virtual BOOL ExchangeProp(LPCTSTR pszPropName, VARTYPE vtProp,
  1233. void* pvProp, const void* pvDefault = NULL) = 0;
  1234. virtual BOOL ExchangeBlobProp(LPCTSTR pszPropName, HGLOBAL* phBlob,
  1235. HGLOBAL hBlobDefault = NULL) = 0;
  1236. virtual BOOL ExchangeFontProp(LPCTSTR pszPropName, CFontHolder& font,
  1237. const FONTDESC* pFontDesc,
  1238. LPFONTDISP pFontDispAmbient) = 0;
  1239. virtual BOOL ExchangePersistentProp(LPCTSTR pszPropName,
  1240. LPUNKNOWN* ppUnk, REFIID iid, LPUNKNOWN pUnkDefault) = 0;
  1241. // Implementation
  1242. protected:
  1243. CPropExchange();
  1244. BOOL m_bLoading;
  1245. BOOL m_bAsync;
  1246. DWORD m_dwVersion;
  1247. };
  1248. /////////////////////////////////////////////////////////////////////////////
  1249. // Property-exchange (PX_) helper functions
  1250. BOOL AFX_CDECL PX_Short(CPropExchange* pPX, LPCTSTR pszPropName, short& sValue);
  1251. BOOL AFX_CDECL PX_Short(CPropExchange* pPX, LPCTSTR pszPropName, short& sValue,
  1252. short sDefault);
  1253. BOOL AFX_CDECL PX_UShort(CPropExchange* pPX, LPCTSTR pszPropName, USHORT& usValue);
  1254. BOOL AFX_CDECL PX_UShort(CPropExchange* pPX, LPCTSTR pszPropName, USHORT& usValue,
  1255. USHORT usDefault);
  1256. BOOL AFX_CDECL PX_Long(CPropExchange* pPX, LPCTSTR pszPropName, long& lValue);
  1257. BOOL AFX_CDECL PX_Long(CPropExchange* pPX, LPCTSTR pszPropName, long& lValue,
  1258. long lDefault);
  1259. BOOL AFX_CDECL PX_ULong(CPropExchange* pPX, LPCTSTR pszPropName, ULONG& ulValue);
  1260. BOOL AFX_CDECL PX_ULong(CPropExchange* pPX, LPCTSTR pszPropName, ULONG& ulValue,
  1261. ULONG ulDefault);
  1262. BOOL AFX_CDECL PX_Color(CPropExchange* pPX, LPCTSTR pszPropName, OLE_COLOR& clrValue);
  1263. BOOL AFX_CDECL PX_Color(CPropExchange* pPX, LPCTSTR pszPropName, OLE_COLOR& clrValue,
  1264. OLE_COLOR clrDefault);
  1265. BOOL AFX_CDECL PX_Bool(CPropExchange* pPX, LPCTSTR pszPropName, BOOL& bValue);
  1266. BOOL AFX_CDECL PX_Bool(CPropExchange* pPX, LPCTSTR pszPropName, BOOL& bValue,
  1267. BOOL bDefault);
  1268. BOOL AFX_CDECL PX_String(CPropExchange* pPX, LPCTSTR pszPropName, CString& strValue);
  1269. BOOL AFX_CDECL PX_String(CPropExchange* pPX, LPCTSTR pszPropName, CString& strValue,
  1270. const CString& strDefault);
  1271. BOOL AFX_CDECL PX_String(CPropExchange* pPX, LPCTSTR pszPropName, CString& strValue,
  1272. LPCTSTR lpszDefault);
  1273. BOOL AFX_CDECL PX_Currency(CPropExchange* pPX, LPCTSTR pszPropName, CY& cyValue);
  1274. BOOL AFX_CDECL PX_Currency(CPropExchange* pPX, LPCTSTR pszPropName, CY& cyValue,
  1275. CY cyDefault);
  1276. BOOL AFX_CDECL PX_Float(CPropExchange* pPX, LPCTSTR pszPropName, float& floatValue);
  1277. BOOL AFX_CDECL PX_Float(CPropExchange* pPX, LPCTSTR pszPropName, float& floatValue,
  1278. float floatDefault);
  1279. BOOL AFX_CDECL PX_Double(CPropExchange* pPX, LPCTSTR pszPropName, double& doubleValue);
  1280. BOOL AFX_CDECL PX_Double(CPropExchange* pPX, LPCTSTR pszPropName, double& doubleValue,
  1281. double doubleDefault);
  1282. BOOL AFX_CDECL PX_Blob(CPropExchange* pPX, LPCTSTR pszPropName, HGLOBAL& hBlob,
  1283. HGLOBAL hBlobDefault = NULL);
  1284. BOOL AFX_CDECL PX_Font(CPropExchange* pPX, LPCTSTR pszPropName, CFontHolder& font,
  1285. const FONTDESC* pFontDesc = NULL,
  1286. LPFONTDISP pFontDispAmbient = NULL);
  1287. BOOL AFX_CDECL PX_Picture(CPropExchange* pPX, LPCTSTR pszPropName,
  1288. CPictureHolder& pict);
  1289. BOOL AFX_CDECL PX_Picture(CPropExchange* pPX, LPCTSTR pszPropName,
  1290. CPictureHolder& pict, CPictureHolder& pictDefault);
  1291. BOOL AFX_CDECL PX_IUnknown(CPropExchange* pPX, LPCTSTR pszPropName, LPUNKNOWN& pUnk,
  1292. REFIID iid, LPUNKNOWN pUnkDefault = NULL);
  1293. BOOL AFX_CDECL PX_VBXFontConvert(CPropExchange* pPX, CFontHolder& font);
  1294. BOOL AFX_CDECL PX_DataPath(CPropExchange* pPX, LPCTSTR pszPropName,
  1295. CDataPathProperty& dataPathProp, LPCTSTR pszDefault = NULL);
  1296. BOOL AFX_CDECL PX_DataPath(CPropExchange* pPX, LPCTSTR pszPropName,
  1297. CDataPathProperty& dataPathProp, const CString& strDefault);
  1298. /////////////////////////////////////////////////////////////////////////////
  1299. // Structures used by COlePropertyPage
  1300. typedef struct tagAFX_PPFIELDSTATUS
  1301. {
  1302. UINT nID;
  1303. BOOL bDirty;
  1304. } AFX_PPFIELDSTATUS;
  1305. /////////////////////////////////////////////////////////////////////////////
  1306. // Property Page Dialog Class
  1307. #ifdef _AFXDLL
  1308. class COlePropertyPage : public CDialog
  1309. #else
  1310. class AFX_NOVTABLE COlePropertyPage : public CDialog
  1311. #endif
  1312. {
  1313. DECLARE_DYNAMIC(COlePropertyPage)
  1314. // Constructors
  1315. public:
  1316. COlePropertyPage(UINT idDlg, UINT idCaption);
  1317. // Operations
  1318. LPDISPATCH* GetObjectArray(ULONG* pnObjects);
  1319. void SetModifiedFlag(BOOL bModified = TRUE);
  1320. BOOL IsModified();
  1321. LPPROPERTYPAGESITE GetPageSite();
  1322. void SetDialogResource(HGLOBAL hDialog);
  1323. void SetPageName(LPCTSTR lpszPageName);
  1324. void SetHelpInfo(LPCTSTR lpszDocString, LPCTSTR lpszHelpFile = NULL,
  1325. DWORD dwHelpContext = 0);
  1326. BOOL GetControlStatus(UINT nID);
  1327. BOOL SetControlStatus(UINT nID, BOOL bDirty);
  1328. void IgnoreApply(UINT nID);
  1329. int MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption = NULL,
  1330. UINT nType = MB_OK);
  1331. // note that this is a non-virtual override of CWnd::MessageBox()
  1332. // Overridables
  1333. virtual void OnSetPageSite();
  1334. virtual void OnObjectsChanged();
  1335. virtual BOOL OnHelp(LPCTSTR lpszHelpDir);
  1336. virtual BOOL OnInitDialog();
  1337. virtual BOOL OnEditProperty(DISPID dispid);
  1338. // Implementation
  1339. // DDP_ property get/set helper routines
  1340. BOOL SetPropText(LPCTSTR pszPropName, BYTE &Value);
  1341. BOOL GetPropText(LPCTSTR pszPropName, BYTE* pValue);
  1342. BOOL SetPropText(LPCTSTR pszPropName, short &Value);
  1343. BOOL GetPropText(LPCTSTR pszPropName, short* pValue);
  1344. BOOL SetPropText(LPCTSTR pszPropName, int &Value);
  1345. BOOL GetPropText(LPCTSTR pszPropName, int* pValue);
  1346. BOOL SetPropText(LPCTSTR pszPropName, UINT &Value);
  1347. BOOL GetPropText(LPCTSTR pszPropName, UINT* pValue);
  1348. BOOL SetPropText(LPCTSTR pszPropName, long &Value);
  1349. BOOL GetPropText(LPCTSTR pszPropName, long* pValue);
  1350. BOOL SetPropText(LPCTSTR pszPropName, DWORD &Value);
  1351. BOOL GetPropText(LPCTSTR pszPropName, DWORD* pValue);
  1352. BOOL SetPropText(LPCTSTR pszPropName, CString &Value);
  1353. BOOL GetPropText(LPCTSTR pszPropName, CString* pValue);
  1354. BOOL SetPropText(LPCTSTR pszPropName, float &Value);
  1355. BOOL GetPropText(LPCTSTR pszPropName, float* pValue);
  1356. BOOL SetPropText(LPCTSTR pszPropName, double &Value);
  1357. BOOL GetPropText(LPCTSTR pszPropName, double* pValue);
  1358. BOOL SetPropCheck(LPCTSTR pszPropName, int Value);
  1359. BOOL GetPropCheck(LPCTSTR pszPropName, int* pValue);
  1360. BOOL SetPropRadio(LPCTSTR pszPropName, int Value);
  1361. BOOL GetPropRadio(LPCTSTR pszPropName, int* pValue);
  1362. BOOL SetPropIndex(LPCTSTR pszPropName, int Value);
  1363. BOOL GetPropIndex(LPCTSTR pszPropName, int* pValue);
  1364. CPtrArray m_arrayDDP; // pending DDP data
  1365. // Destructors
  1366. ~COlePropertyPage();
  1367. protected:
  1368. LRESULT WindowProc(UINT msg, WPARAM wParam, LPARAM lParam);
  1369. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  1370. BOOL PreTranslateMessage(LPMSG lpMsg);
  1371. virtual void OnFinalRelease();
  1372. void CleanupObjectArray();
  1373. static BOOL CALLBACK EnumChildProc(HWND hWnd, LPARAM lParam);
  1374. static BOOL CALLBACK EnumControls(HWND hWnd, LPARAM lParam);
  1375. private:
  1376. BOOL m_bDirty;
  1377. UINT m_idDlg;
  1378. UINT m_idCaption;
  1379. CString m_strPageName;
  1380. SIZE m_sizePage;
  1381. CString m_strDocString;
  1382. CString m_strHelpFile;
  1383. DWORD m_dwHelpContext;
  1384. LPPROPERTYPAGESITE m_pPageSite;
  1385. LPDISPATCH* m_ppDisp; // Array of IDispatch pointers, used to
  1386. // access the properties of each control
  1387. LPDWORD m_pAdvisors; // Array of connection tokens used by
  1388. // IConnecitonPoint::Advise/UnAdvise.
  1389. BOOL m_bPropsChanged; // IPropertyNotifySink::OnChanged has been
  1390. // called, but not acted upon yet.
  1391. ULONG m_nObjects; // Objects in m_ppDisp, m_ppDataObj, m_pAdvisors
  1392. BOOL m_bInitializing; // TRUE if the contents of the fields of
  1393. // the dialog box are being initialized
  1394. int m_nControls; // Number of fields on this property page
  1395. AFX_PPFIELDSTATUS* m_pStatus; // Array containing information on
  1396. // which fields are dirty
  1397. CDWordArray m_IDArray; // Array containing information on which
  1398. // controls to ignore when deciding if
  1399. // the apply button is to be enabled
  1400. HGLOBAL m_hDialog; // Handle of the dialog resource
  1401. #ifdef _DEBUG
  1402. protected:
  1403. BOOL m_bNonStandardSize;
  1404. #endif
  1405. protected:
  1406. // Generated message map functions
  1407. //{{AFX_MSG(COlePropertyPage)
  1408. afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
  1409. //}}AFX_MSG
  1410. DECLARE_MESSAGE_MAP()
  1411. // Interface Maps
  1412. public:
  1413. BEGIN_INTERFACE_PART(PropertyPage, IPropertyPage2)
  1414. INIT_INTERFACE_PART(COlePropertyPage, PropertyPage)
  1415. STDMETHOD(SetPageSite)(LPPROPERTYPAGESITE);
  1416. STDMETHOD(Activate)(HWND, LPCRECT, BOOL);
  1417. STDMETHOD(Deactivate)();
  1418. STDMETHOD(GetPageInfo)(LPPROPPAGEINFO);
  1419. STDMETHOD(SetObjects)(ULONG, LPUNKNOWN*);
  1420. STDMETHOD(Show)(UINT);
  1421. STDMETHOD(Move)(LPCRECT);
  1422. STDMETHOD(IsPageDirty)();
  1423. STDMETHOD(Apply)();
  1424. STDMETHOD(Help)(LPCOLESTR);
  1425. STDMETHOD(TranslateAccelerator)(LPMSG);
  1426. STDMETHOD(EditProperty)(DISPID);
  1427. END_INTERFACE_PART(PropertyPage)
  1428. BEGIN_INTERFACE_PART(PropNotifySink, IPropertyNotifySink)
  1429. INIT_INTERFACE_PART(COlePropertyPage, PropNotifySink)
  1430. STDMETHOD(OnRequestEdit)(DISPID);
  1431. STDMETHOD(OnChanged)(DISPID);
  1432. END_INTERFACE_PART(PropNotifySink)
  1433. DECLARE_INTERFACE_MAP()
  1434. };
  1435. #if _MFC_VER >= 0x0600
  1436. /////////////////////////////////////////////////////////////////////////////
  1437. // CStockPropPage
  1438. #ifdef _AFXDLL
  1439. class CStockPropPage : public COlePropertyPage
  1440. #else
  1441. class AFX_NOVTABLE CStockPropPage : public COlePropertyPage
  1442. #endif
  1443. {
  1444. DECLARE_DYNAMIC(CStockPropPage)
  1445. // Constructor
  1446. public:
  1447. CStockPropPage(UINT idDlg, UINT idCaption);
  1448. // Implementation
  1449. protected:
  1450. void FillPropnameList(REFGUID guid, int nIndirect, CComboBox& combo);
  1451. void OnSelchangePropname(CComboBox& combo);
  1452. BOOL OnEditProperty(DISPID dispid, CComboBox& combo);
  1453. LCID m_lcid;
  1454. CString m_strPropName;
  1455. int m_iPropName;
  1456. DECLARE_MESSAGE_MAP()
  1457. };
  1458. ///////////////////////////////////////////////////////////////////////////////
  1459. // CColorButton: used by CColorPropPage
  1460. class CColorButton : public CButton
  1461. {
  1462. public:
  1463. CColorButton(void);
  1464. void SetFaceColor(COLORREF colFace);
  1465. COLORREF colGetFaceColor(void);
  1466. void SetState(BOOL fSelected);
  1467. static UINT idClicked;
  1468. protected:
  1469. virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  1470. private:
  1471. BOOL m_fSelected;
  1472. COLORREF m_colFace;
  1473. };
  1474. /////////////////////////////////////////////////////////////////////////////
  1475. // CColorPropPage
  1476. class CColorPropPage : public CStockPropPage
  1477. {
  1478. DECLARE_DYNCREATE(CColorPropPage)
  1479. #ifdef _AFXDLL
  1480. DECLARE_OLECREATE_EX(CColorPropPage)
  1481. #endif
  1482. // Construction
  1483. public:
  1484. CColorPropPage(); // Constructor
  1485. // Dialog Data
  1486. //{{AFX_DATA(CColorPropPage)
  1487. enum { IDD = AFX_IDD_PROPPAGE_COLOR };
  1488. CComboBox m_SysColors;
  1489. CComboBox m_ColorProp;
  1490. //}}AFX_DATA
  1491. // Implementation
  1492. public:
  1493. enum { NBUTTONS = 16 };
  1494. protected:
  1495. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  1496. virtual BOOL OnInitDialog(void);
  1497. virtual BOOL OnEditProperty(DISPID dispid);
  1498. virtual void OnObjectsChanged();
  1499. void FillSysColors();
  1500. BOOL SetColorProp(CDataExchange* pDX, COLORREF color, LPCTSTR pszPropName);
  1501. BOOL GetColorProp(CDataExchange* pDX, COLORREF* pcolor, LPCTSTR pszPropName);
  1502. private:
  1503. CColorButton m_Buttons[NBUTTONS];
  1504. CColorButton *m_pSelectedButton;
  1505. void SetButton(CColorButton *Button);
  1506. // Generated message map functions
  1507. //{{AFX_MSG(CColorPropPage)
  1508. afx_msg void OnSelchangeColorprop();
  1509. afx_msg void OnSelect(void);
  1510. afx_msg void OnSelchangeSystemcolors();
  1511. //}}AFX_MSG
  1512. DECLARE_MESSAGE_MAP()
  1513. };
  1514. // Stores all the information about a font
  1515. typedef struct tagFONTOBJECT
  1516. {
  1517. CString strName;
  1518. CY cySize;
  1519. BOOL bBold;
  1520. BOOL bItalic;
  1521. BOOL bUnderline;
  1522. BOOL bStrikethrough;
  1523. short sWeight;
  1524. } FONTOBJECT;
  1525. // Merge objects are used when trying to consolidate multiple font properties.
  1526. // If the characteristics of these multiple properties differ then this is
  1527. // represented in the merge object.
  1528. typedef struct tagMERGEOBJECT
  1529. {
  1530. BOOL bNameOK;
  1531. BOOL bSizeOK;
  1532. BOOL bStyleOK;
  1533. BOOL bUnderlineOK;
  1534. BOOL bStrikethroughOK;
  1535. } MERGEOBJECT;
  1536. /////////////////////////////////////////////////////////////////////////////
  1537. // CSizeComboBox window
  1538. class CSizeComboBox : public CComboBox
  1539. {
  1540. // Operations
  1541. public:
  1542. int AddSize(int PointSize, LONG lfHeight);
  1543. void GetPointSize(CY& cy);
  1544. LONG GetHeight(int sel=-1);
  1545. void UpdateLogFont( LPLOGFONT lpLF, int sel=-1 );
  1546. };
  1547. /////////////////////////////////////////////////////////////////////////////
  1548. // CFontComboBox window
  1549. struct FONTITEM_PPG
  1550. {
  1551. DWORD dwFontType;
  1552. LOGFONT lf;
  1553. };
  1554. class CFontComboBox : public CComboBox
  1555. {
  1556. // Construction
  1557. public:
  1558. CFontComboBox();
  1559. virtual ~CFontComboBox();
  1560. // Operations
  1561. public:
  1562. int AddFont(LOGFONT *, DWORD);
  1563. CString GetCurrentName();
  1564. FONTITEM_PPG* GetFontItem(int sel=-1);
  1565. LPLOGFONT GetLogFont(int sel=-1);
  1566. DWORD GetFontType(int sel=-1);
  1567. // Implementation
  1568. public:
  1569. virtual void DrawItem(LPDRAWITEMSTRUCT lpDIS);
  1570. virtual void DeleteItem(LPDELETEITEMSTRUCT lpDIS);
  1571. protected:
  1572. CBitmap m_bmpTrueType;
  1573. CBitmap m_bmpMask;
  1574. };
  1575. ///////////////////////////////////////////////////////////////////////////
  1576. // CFontPropPage class
  1577. class CFontPropPage : public CStockPropPage
  1578. {
  1579. DECLARE_DYNCREATE(CFontPropPage)
  1580. #ifdef _AFXDLL
  1581. DECLARE_OLECREATE_EX(CFontPropPage)
  1582. #endif
  1583. public:
  1584. CFontPropPage();
  1585. // Dialog Data
  1586. //{{AFX_DATA(CFontPropPage)
  1587. enum { IDD = AFX_IDD_PROPPAGE_FONT };
  1588. CComboBox m_FontProp;
  1589. CStatic m_SampleBox;
  1590. CComboBox m_FontStyles;
  1591. CSizeComboBox m_FontSizes;
  1592. CFontComboBox m_FontNames;
  1593. //}}AFX_DATA
  1594. // Attributes
  1595. protected:
  1596. int nPixelsY;
  1597. CFont SampleFont;
  1598. DWORD m_nCurrentStyle;
  1599. DWORD m_nActualStyle;
  1600. DWORD m_nStyles;
  1601. BOOL m_bStrikeOut;
  1602. BOOL m_bUnderline;
  1603. CString m_strFontSize;
  1604. // Implementation
  1605. protected:
  1606. void FillFacenameList();
  1607. void FillSizeList();
  1608. virtual void DoDataExchange(CDataExchange* pDX);
  1609. virtual void OnPaint();
  1610. virtual BOOL OnEditProperty(DISPID dispid);
  1611. virtual void OnObjectsChanged();
  1612. void UpdateSampleFont();
  1613. void SelectFontFromList(CString strFaceName, MERGEOBJECT* pmobj);
  1614. //{{AFX_MSG(CFontPropPage)
  1615. virtual BOOL OnInitDialog();
  1616. afx_msg void OnEditupdateFontnames();
  1617. afx_msg void OnEditupdateFontsizes();
  1618. afx_msg void OnSelchangeFontnames();
  1619. afx_msg void OnSelchangeFontsizes();
  1620. afx_msg void OnSelchangeFontstyles();
  1621. afx_msg void OnEditchangeFontstyles();
  1622. afx_msg void OnStrikeout();
  1623. afx_msg void OnUnderline();
  1624. afx_msg void OnSelchangeFontprop();
  1625. //}}AFX_MSG
  1626. DECLARE_MESSAGE_MAP()
  1627. static int CALLBACK EnumFontFamiliesCallBack(ENUMLOGFONT* lpelf, NEWTEXTMETRIC* lpntm, int FontType, LPARAM lParam);
  1628. static int CALLBACK EnumFontFamiliesCallBack2(ENUMLOGFONT* lpelf, NEWTEXTMETRIC* lpntm, int FontType, LPARAM lParam);
  1629. BOOL SetFontProps(CDataExchange* pDX, FONTOBJECT fobj, LPCTSTR pszPropName);
  1630. BOOL GetFontProps(CDataExchange* pDX, FONTOBJECT* pfobj, LPCTSTR pszPropName, MERGEOBJECT* pmobj);
  1631. };
  1632. ////////////////////////////////////////////////////////////////////////////
  1633. // CPicturePropPage
  1634. class CPicturePropPage : public CStockPropPage
  1635. {
  1636. DECLARE_DYNCREATE(CPicturePropPage)
  1637. #ifdef _AFXDLL
  1638. DECLARE_OLECREATE_EX(CPicturePropPage)
  1639. #endif
  1640. // Construction
  1641. public:
  1642. CPicturePropPage(); // standard constructor
  1643. ~CPicturePropPage();
  1644. // Dialog Data
  1645. //{{AFX_DATA(CPicturePropPage)
  1646. enum { IDD = AFX_IDD_PROPPAGE_PICTURE };
  1647. CComboBox m_PropName;
  1648. CStatic m_Static;
  1649. //}}AFX_DATA
  1650. // Implementation
  1651. protected:
  1652. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  1653. virtual BOOL OnInitDialog(void);
  1654. virtual BOOL OnEditProperty(DISPID dispid);
  1655. virtual void OnObjectsChanged();
  1656. BOOL SetPictureProp(CDataExchange* pDX, LPPICTUREDISP pPictDisp, LPCTSTR pszPropName);
  1657. BOOL GetPictureProp(CDataExchange* pDX, LPPICTUREDISP* ppPictDisp, LPCTSTR pszPropName);
  1658. void ChangePicture(LPPICTURE pPict);
  1659. LPPICTUREDISP m_pPictDisp;
  1660. // Generated message map functions
  1661. protected:
  1662. //{{AFX_MSG(CPicturePropPage)
  1663. afx_msg void OnPaint();
  1664. afx_msg void OnBrowse();
  1665. afx_msg void OnClear();
  1666. afx_msg void OnSelchangePictProp();
  1667. //}}AFX_MSG
  1668. DECLARE_MESSAGE_MAP()
  1669. };
  1670. #endif // _MFC_VER >= 0x0600
  1671. /////////////////////////////////////////////////////////////////////////////
  1672. // Property Page Dialog Data Exchange routines
  1673. // simple text operations
  1674. void AFXAPI DDP_Text(CDataExchange*pDX, int id, BYTE& member, LPCTSTR pszPropName);
  1675. void AFXAPI DDP_Text(CDataExchange*pDX, int id, short& member, LPCTSTR pszPropName);
  1676. void AFXAPI DDP_Text(CDataExchange*pDX, int id, int& member, LPCTSTR pszPropName);
  1677. void AFXAPI DDP_Text(CDataExchange*pDX, int id, UINT& member, LPCTSTR pszPropName);
  1678. void AFXAPI DDP_Text(CDataExchange*pDX, int id, long& member, LPCTSTR pszPropName);
  1679. void AFXAPI DDP_Text(CDataExchange*pDX, int id, DWORD& member, LPCTSTR pszPropName);
  1680. void AFXAPI DDP_Text(CDataExchange*pDX, int id, float& member, LPCTSTR pszPropName);
  1681. void AFXAPI DDP_Text(CDataExchange*pDX, int id, double& member, LPCTSTR pszPropName);
  1682. void AFXAPI DDP_Text(CDataExchange*pDX, int id, CString& member, LPCTSTR pszPropName);
  1683. void AFXAPI DDP_Check(CDataExchange*pDX, int id, int& member, LPCTSTR pszPropName);
  1684. void AFXAPI DDP_Radio(CDataExchange*pDX, int id, int& member, LPCTSTR pszPropName);
  1685. void AFXAPI DDP_LBString(CDataExchange* pDX, int id, CString& member, LPCTSTR pszPropName);
  1686. void AFXAPI DDP_LBStringExact(CDataExchange* pDX, int id, CString& member, LPCTSTR pszPropName);
  1687. void AFXAPI DDP_LBIndex(CDataExchange* pDX, int id, int& member, LPCTSTR pszPropName);
  1688. void AFXAPI DDP_CBString(CDataExchange* pDX, int id, CString& member, LPCTSTR pszPropName);
  1689. void AFXAPI DDP_CBStringExact(CDataExchange* pDX, int id, CString& member, LPCTSTR pszPropName);
  1690. void AFXAPI DDP_CBIndex(CDataExchange* pDX, int id, int& member, LPCTSTR pszPropName);
  1691. void AFXAPI DDP_PostProcessing(CDataExchange *pDX);
  1692. ////////////////////////////////////////////////////////////////////////////
  1693. // AfxOleTypeMatchGuid - Tests whether a given TYPEDESC matches a type with a
  1694. // given GUID, when all aliases have been expanded.
  1695. BOOL AFXAPI AfxOleTypeMatchGuid(LPTYPEINFO pTypeInfo,
  1696. TYPEDESC* pTypeDesc, REFGUID guidType, ULONG cIndirectionLevels);
  1697. /////////////////////////////////////////////////////////////////////////////
  1698. // Inline function declarations
  1699. #ifdef _AFX_PACKING
  1700. #pragma pack(pop)
  1701. #endif
  1702. #ifdef _AFX_ENABLE_INLINES
  1703. #define _AFXCTL_INLINE AFX_INLINE
  1704. #include <afxctl.inl>
  1705. #endif
  1706. #undef AFX_DATA
  1707. #define AFX_DATA
  1708. #ifdef _AFX_MINREBUILD
  1709. #pragma component(minrebuild, on)
  1710. #endif
  1711. #ifndef _AFX_FULLTYPEINFO
  1712. #pragma component(mintypeinfo, off)
  1713. #endif
  1714. #endif // __AFXCTL_H__
  1715. /////////////////////////////////////////////////////////////////////////////