home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC / src / afximpl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  18.7 KB  |  628 lines

  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. #undef AFX_DATA
  12. #define AFX_DATA AFX_CORE_DATA
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // Auxiliary System/Screen metrics
  16.  
  17. struct AUX_DATA
  18. {
  19.     // system metrics
  20.     int cxVScroll, cyHScroll;
  21.     int cxIcon, cyIcon;
  22.  
  23.     int cxBorder2, cyBorder2;
  24.  
  25.     // device metrics for screen
  26.     int cxPixelsPerInch, cyPixelsPerInch;
  27.  
  28.     // convenient system color
  29.     HBRUSH hbrWindowFrame;
  30.     HBRUSH hbrBtnFace;
  31.  
  32.     // color values of system colors used for CToolBar
  33.     COLORREF clrBtnFace, clrBtnShadow, clrBtnHilite;
  34.     COLORREF clrBtnText, clrWindowFrame;
  35.  
  36.     // standard cursors
  37.     HCURSOR hcurWait;
  38.     HCURSOR hcurArrow;
  39.     HCURSOR hcurHelp;       // cursor used in Shift+F1 help
  40.  
  41.     // special GDI objects allocated on demand
  42.     HFONT   hStatusFont;
  43.     HFONT   hToolTipsFont;
  44.     HBITMAP hbmMenuDot;
  45.  
  46.     // other system information
  47.     UINT    nWinVer;        // Major.Minor version numbers
  48.     BOOL    bWin95;            // TRUE if Windows 95 (not NT)
  49.     BOOL    bWin4;          // TRUE if Windows 4.0
  50.     BOOL    bNotWin4;       // TRUE if not Windows 4.0
  51.     BOOL    bSmCaption;     // TRUE if WS_EX_SMCAPTION is supported
  52.     BOOL    bMarked4;       // TRUE if marked as 4.0
  53.  
  54. // Implementation
  55.     AUX_DATA();
  56.     ~AUX_DATA();
  57.     void UpdateSysColors();
  58.     void UpdateSysMetrics();
  59. };
  60.  
  61. extern AFX_DATA AUX_DATA afxData;
  62.  
  63. /////////////////////////////////////////////////////////////////////////////
  64. // _AFX_CTL3D_STATE
  65.  
  66. #ifndef _AFX_NO_CTL3D_SUPPORT
  67.  
  68. #undef AFX_DATA
  69. #define AFX_DATA
  70.  
  71. class _AFX_CTL3D_STATE : public CNoTrackObject
  72. {
  73. public:
  74.     virtual ~_AFX_CTL3D_STATE();
  75.  
  76.     // setup during initialization
  77.     BOOL m_bCtl3dInited;
  78.     HINSTANCE m_hCtl3dLib;
  79.  
  80.     // CTL3D32 entry points
  81.     BOOL (WINAPI* m_pfnRegister)(HINSTANCE);
  82.     BOOL (WINAPI* m_pfnUnregister)(HINSTANCE);
  83.     BOOL (WINAPI* m_pfnAutoSubclass)(HINSTANCE);
  84.     BOOL (WINAPI* m_pfnUnAutoSubclass)();
  85.     BOOL (WINAPI* m_pfnColorChange)();
  86.     BOOL (WINAPI* m_pfnSubclassDlgEx)(HWND, DWORD);
  87.     void (WINAPI* m_pfnWinIniChange)();
  88.     BOOL (WINAPI* m_pfnSubclassCtl)(HWND);
  89.     BOOL (WINAPI* m_pfnSubclassCtlEx)(HWND, int);
  90. };
  91.  
  92. EXTERN_PROCESS_LOCAL(_AFX_CTL3D_STATE, _afxCtl3dState)
  93.  
  94. class _AFX_CTL3D_THREAD : public CNoTrackObject
  95. {
  96. public:
  97.     virtual ~_AFX_CTL3D_THREAD();
  98. };
  99.  
  100. EXTERN_THREAD_LOCAL(_AFX_CTL3D_THREAD, _afxCtl3dThread)
  101.  
  102. _AFX_CTL3D_STATE* AFXAPI AfxGetCtl3dState();
  103.  
  104. #endif //!_AFX_NO_CTL3D_SUPPORT
  105.  
  106. /////////////////////////////////////////////////////////////////////////////
  107. // _AFX_EDIT_STATE
  108.  
  109. #if !defined(_WIN32_WCE_NO_FINDREPLACE)
  110. class _AFX_EDIT_STATE : public CNoTrackObject
  111. {
  112. public:
  113.     _AFX_EDIT_STATE();
  114.     virtual ~_AFX_EDIT_STATE();
  115.  
  116.     CFindReplaceDialog* pFindReplaceDlg; // find or replace dialog
  117.     BOOL bFindOnly; // Is pFindReplace the find or replace?
  118.     CString strFind;    // last find string
  119.     CString strReplace; // last replace string
  120.     BOOL bCase; // TRUE==case sensitive, FALSE==not
  121.     int bNext;  // TRUE==search down, FALSE== search up
  122.     BOOL bWord; // TRUE==match whole word, FALSE==not
  123. };
  124.  
  125. #undef AFX_DATA
  126. #define AFX_DATA AFX_CORE_DATA
  127. #endif // _WIN32_WCE_NO_FINDREPLACE
  128.  
  129. #if !defined(_WIN32_WCE)
  130. class _AFX_RICHEDIT_STATE : public _AFX_EDIT_STATE
  131. {
  132. public:
  133.     HINSTANCE m_hInstRichEdit;      // handle to RICHED32.DLL
  134.     virtual ~_AFX_RICHEDIT_STATE();
  135. };
  136.  
  137. EXTERN_PROCESS_LOCAL(_AFX_RICHEDIT_STATE, _afxRichEditState)
  138.  
  139. _AFX_RICHEDIT_STATE* AFX_CDECL AfxGetRichEditState();
  140.  
  141. #undef AFX_DATA
  142. #define AFX_DATA
  143. #endif // _WIN32_WCE
  144.  
  145. ////////////////////////////////////////////////////////////////////////////
  146. // other global state
  147.  
  148. class CPushRoutingFrame
  149. {
  150. protected:
  151.     CFrameWnd* pOldRoutingFrame;
  152.     _AFX_THREAD_STATE* pThreadState;
  153.  
  154. public:
  155.     CPushRoutingFrame(CFrameWnd* pNewRoutingFrame)
  156.     { 
  157.         pThreadState = AfxGetThreadState();
  158.         pOldRoutingFrame = pThreadState->m_pRoutingFrame;
  159.         pThreadState->m_pRoutingFrame = pNewRoutingFrame;
  160.     }
  161.     ~CPushRoutingFrame()
  162.     { pThreadState->m_pRoutingFrame = pOldRoutingFrame; }
  163. };
  164.  
  165. class CPushRoutingView
  166. {
  167. protected:
  168.     CView* pOldRoutingView;
  169.     _AFX_THREAD_STATE* pThreadState;
  170.  
  171. public:
  172.     CPushRoutingView(CView* pNewRoutingView)
  173.     {
  174.         pThreadState = AfxGetThreadState();
  175.         pOldRoutingView = pThreadState->m_pRoutingView;
  176.         pThreadState->m_pRoutingView = pNewRoutingView;
  177.     }
  178.     ~CPushRoutingView()
  179.     { pThreadState->m_pRoutingView = pOldRoutingView; }
  180. };
  181.  
  182. // Note: afxData.cxBorder and afxData.cyBorder aren't used anymore
  183. #define CX_BORDER   1
  184. #define CY_BORDER   1
  185.  
  186. // states for Shift+F1 hep mode
  187. #define HELP_INACTIVE   0   // not in Shift+F1 help mode (must be 0)
  188. #define HELP_ACTIVE     1   // in Shift+F1 help mode (non-zero)
  189. #define HELP_ENTERING   2   // entering Shift+F1 help mode (non-zero)
  190.  
  191. /////////////////////////////////////////////////////////////////////////////
  192. // Window class names and other window creation support
  193.  
  194. // from wincore.cpp
  195. extern const TCHAR _afxWnd[];           // simple child windows/controls
  196. extern const TCHAR _afxWndControlBar[]; // controls with gray backgrounds
  197. extern const TCHAR _afxWndMDIFrame[];
  198. extern const TCHAR _afxWndFrameOrView[];
  199. extern const TCHAR _afxWndOleControl[];
  200.  
  201. #define AFX_WND_REG                        0x00001
  202. #define AFX_WNDCONTROLBAR_REG            0x00002
  203. #define AFX_WNDMDIFRAME_REG                0x00004
  204. #define AFX_WNDFRAMEORVIEW_REG            0x00008
  205. #define AFX_WNDCOMMCTLS_REG                0x00010    // means all original Win95
  206. #define AFX_WNDOLECONTROL_REG            0x00020
  207. #define AFX_WNDCOMMCTL_UPDOWN_REG       0x00040    // these are original Win95
  208. #define AFX_WNDCOMMCTL_TREEVIEW_REG     0x00080
  209. #define AFX_WNDCOMMCTL_TAB_REG            0x00100
  210. #define AFX_WNDCOMMCTL_PROGRESS_REG        0x00200
  211. #define AFX_WNDCOMMCTL_LISTVIEW_REG        0x00400
  212. #define AFX_WNDCOMMCTL_HOTKEY_REG        0x00800
  213. #define AFX_WNDCOMMCTL_BAR_REG            0x01000
  214. #define AFX_WNDCOMMCTL_ANIMATE_REG        0x02000
  215. #define AFX_WNDCOMMCTL_INTERNET_REG        0x04000    // these are new in IE4
  216. #define AFX_WNDCOMMCTL_COOL_REG            0x08000
  217. #define AFX_WNDCOMMCTL_USEREX_REG       0x10000
  218. #define AFX_WNDCOMMCTL_DATE_REG            0x20000
  219.  
  220. #define AFX_WIN95CTLS_MASK                0x03FC0    // UPDOWN -> ANIMATE
  221. #define AFX_WNDCOMMCTLSALL_REG            0x3C010    // COMMCTLS|INTERNET|COOL|USEREX|DATE
  222. #define AFX_WNDCOMMCTLSNEW_REG            0x3C000 // INTERNET|COOL|USEREX|DATE
  223.  
  224. #define AfxDeferRegisterClass(fClass) AfxEndDeferRegisterClass(fClass)
  225.  
  226. BOOL AFXAPI AfxEndDeferRegisterClass(LONG fToRegister);
  227.  
  228. // MFC has its own version of the TOOLINFO structure containing the
  229. // the Win95 base version of the structure. Since MFC targets Win95 base,
  230. // we need this structure so calls into that old library don't fail.
  231.  
  232. typedef struct tagAFX_OLDTOOLINFO {
  233.     UINT cbSize;
  234.     UINT uFlags;
  235.     HWND hwnd;
  236.     UINT uId;
  237.     RECT rect;
  238.     HINSTANCE hinst;
  239.     LPTSTR lpszText;
  240. } AFX_OLDTOOLINFO;
  241.  
  242. // special AFX window class name mangling
  243.  
  244. #ifndef _UNICODE
  245. #define _UNICODE_SUFFIX
  246. #else
  247. #define _UNICODE_SUFFIX _T("u")
  248. #endif
  249.  
  250. #ifndef _DEBUG
  251. #define _DEBUG_SUFFIX
  252. #else
  253. #define _DEBUG_SUFFIX _T("d")
  254. #endif
  255.  
  256. #ifdef _AFXDLL
  257. #define _STATIC_SUFFIX
  258. #else
  259. #define _STATIC_SUFFIX _T("s")
  260. #endif
  261.  
  262. #define AFX_WNDCLASS(s) \
  263.     _T("Afx") _T(s) _T("42") _STATIC_SUFFIX _UNICODE_SUFFIX _DEBUG_SUFFIX
  264.  
  265. #define AFX_WND             AFX_WNDCLASS("Wnd")
  266. #define AFX_WNDCONTROLBAR   AFX_WNDCLASS("ControlBar")
  267. #define AFX_WNDMDIFRAME     AFX_WNDCLASS("MDIFrame")
  268. #define AFX_WNDFRAMEORVIEW  AFX_WNDCLASS("FrameOrView")
  269. #define AFX_WNDOLECONTROL   AFX_WNDCLASS("OleControl")
  270.  
  271. // dialog/commdlg hook procs
  272. BOOL CALLBACK AfxDlgProc(HWND, UINT, WPARAM, LPARAM);
  273. UINT CALLBACK _AfxCommDlgProc(HWND hWnd, UINT, WPARAM, LPARAM);
  274.  
  275. // support for standard dialogs
  276. #if !defined(_WIN32_WCE_NO_COLORDLG)
  277. extern UINT _afxMsgSETRGB;
  278. #endif // _WIN32_WCE_NO_COLORDLG
  279. typedef UINT (CALLBACK* COMMDLGPROC)(HWND, UINT, UINT, LONG);
  280.  
  281. /////////////////////////////////////////////////////////////////////////////
  282. // Extended dialog templates (new in Win95)
  283.  
  284. #pragma pack(push, 1)
  285.  
  286. typedef struct
  287. {
  288.     WORD dlgVer;
  289.     WORD signature;
  290.     DWORD helpID;
  291.     DWORD exStyle;
  292.     DWORD style;
  293.     WORD cDlgItems;
  294.     short x;
  295.     short y;
  296.     short cx;
  297.     short cy;
  298. } DLGTEMPLATEEX;
  299.  
  300. typedef struct
  301. {
  302.     DWORD helpID;
  303.     DWORD exStyle;
  304.     DWORD style;
  305.     short x;
  306.     short y;
  307.     short cx;
  308.     short cy;
  309.     DWORD id;
  310. } DLGITEMTEMPLATEEX;
  311.  
  312. #pragma pack(pop)
  313.  
  314. /////////////////////////////////////////////////////////////////////////////
  315. // Special helpers
  316.  
  317. void AFXAPI AfxCancelModes(HWND hWndRcvr);
  318. HWND AFXAPI AfxGetParentOwner(HWND hWnd);
  319. BOOL AFXAPI AfxIsDescendant(HWND hWndParent, HWND hWndChild);
  320. BOOL AFXAPI AfxHelpEnabled();  // determine if ID_HELP handler exists
  321. void AFXAPI AfxDeleteObject(HGDIOBJ* pObject);
  322. BOOL AFXAPI AfxCustomLogFont(UINT nIDS, LOGFONT* pLogFont);
  323. BOOL AFXAPI AfxGetPropSheetFont(CString& strFace, WORD& wSize, BOOL bWizard);
  324.  
  325. BOOL AFXAPI _AfxIsComboBoxControl(HWND hWnd, UINT nStyle);
  326. BOOL AFXAPI _AfxCheckCenterDialog(LPCTSTR lpszResource);
  327. BOOL AFXAPI _AfxCompareClassName(HWND hWnd, LPCTSTR lpszClassName);
  328. HWND AFXAPI _AfxChildWindowFromPoint(HWND, POINT);
  329.  
  330. // for determining version of COMCTL32.DLL
  331. #define VERSION_WIN4    MAKELONG(0, 4)
  332. #define VERSION_IE3        MAKELONG(70, 4)
  333. #define VERSION_IE4        MAKELONG(71, 4)
  334. #define VERSION_IE401    MAKELONG(72, 4)
  335. extern int _afxComCtlVersion;
  336. DWORD AFXAPI _AfxGetComCtlVersion();
  337.  
  338. #undef AFX_DATA
  339. #define AFX_DATA AFX_CORE_DATA
  340.  
  341. // UNICODE/MBCS abstractions
  342. #ifdef _MBCS
  343.     extern AFX_DATA const BOOL _afxDBCS;
  344. #else
  345.     #define _afxDBCS FALSE
  346. #endif
  347.  
  348. #undef AFX_DATA
  349. #define AFX_DATA
  350.  
  351. // determine number of elements in an array (not bytes)
  352. #define _countof(array) (sizeof(array)/sizeof(array[0]))
  353.  
  354. #ifndef _AFX_PORTABLE
  355. int AFX_CDECL AfxCriticalNewHandler(size_t nSize);
  356. #endif
  357.  
  358. void AFXAPI AfxGlobalFree(HGLOBAL hGlobal);
  359.  
  360. /////////////////////////////////////////////////////////////////////////////
  361. // static exceptions
  362.  
  363. extern CNotSupportedException _simpleNotSupportedException;
  364. extern CMemoryException _simpleMemoryException;
  365. extern CUserException _simpleUserException;
  366. extern CResourceException _simpleResourceException;
  367.  
  368. /////////////////////////////////////////////////////////////////////////////
  369. // useful message ranges
  370.  
  371. #define WM_SYSKEYFIRST  WM_SYSKEYDOWN
  372. #define WM_SYSKEYLAST   WM_SYSDEADCHAR
  373.  
  374. #define WM_NCMOUSEFIRST WM_NCMOUSEMOVE
  375. #define WM_NCMOUSELAST  WM_NCMBUTTONDBLCLK
  376.  
  377.  
  378. /////////////////////////////////////////////////////////////////////////////
  379. // AFX_CRITICAL_SECTION
  380.  
  381. #undef AFX_DATA
  382. #define AFX_DATA AFX_CORE_DATA
  383.  
  384. // these globals are protected by the same critical section
  385. #define CRIT_DYNLINKLIST    0
  386. #define CRIT_RUNTIMECLASSLIST   0
  387. #define CRIT_OBJECTFACTORYLIST  0
  388. #define CRIT_LOCKSHARED 0
  389. // these globals are not protected by independent critical sections
  390. #define CRIT_REGCLASSLIST   1
  391. #define CRIT_WAITCURSOR     2
  392. #define CRIT_DROPSOURCE     3
  393. #define CRIT_DROPTARGET     4
  394. #define CRIT_RECTTRACKER    5
  395. #define CRIT_EDITVIEW       6
  396. #define CRIT_WINMSGCACHE    7
  397. #define CRIT_HALFTONEBRUSH  8
  398. #define CRIT_SPLITTERWND    9
  399. #define CRIT_MINIFRAMEWND   10
  400. #define CRIT_CTLLOCKLIST    11
  401. #define CRIT_DYNDLLLOAD     12
  402. #define CRIT_TYPELIBCACHE   13
  403. #define CRIT_STOCKMASK      14
  404. #define CRIT_ODBC           15
  405. #define CRIT_PROCESSLOCAL   16
  406. #define CRIT_MAX    17  // Note: above plus one!
  407.  
  408. #ifdef _MT
  409. void AFXAPI AfxLockGlobals(int nLockType);
  410. void AFXAPI AfxUnlockGlobals(int nLockType);
  411. BOOL AFXAPI AfxCriticalInit();
  412. void AFXAPI AfxCriticalTerm();
  413. #else
  414. #define AfxLockGlobals(nLockType)
  415. #define AfxUnlockGlobals(nLockType)
  416. #define AfxCriticalInit() (TRUE)
  417. #define AfxCriticalTerm()
  418. #endif
  419.  
  420. /////////////////////////////////////////////////////////////////////////////
  421. // Portability abstractions
  422.  
  423. #define _AfxSetDlgCtrlID(hWnd, nID)     SetWindowLong(hWnd, GWL_ID, nID)
  424. #define _AfxGetDlgCtrlID(hWnd)          ((UINT)(WORD)::GetDlgCtrlID(hWnd))
  425.  
  426. // misc helpers
  427. BOOL AFXAPI AfxFullPath(LPTSTR lpszPathOut, LPCTSTR lpszFileIn);
  428. BOOL AFXAPI AfxComparePath(LPCTSTR lpszPath1, LPCTSTR lpszPath2);
  429.  
  430. UINT AFXAPI AfxGetFileTitle(LPCTSTR lpszPathName, LPTSTR lpszTitle, UINT nMax);
  431. UINT AFXAPI AfxGetFileName(LPCTSTR lpszPathName, LPTSTR lpszTitle, UINT nMax);
  432. void AFX_CDECL AfxTimeToFileTime(const CTime& time, LPFILETIME pFileTime);
  433. void AFXAPI AfxGetRoot(LPCTSTR lpszPath, CString& strRoot);
  434.  
  435. #ifndef _AFX_NO_OLE_SUPPORT
  436. class AFX_COM
  437. {
  438. public:
  439.     HRESULT CreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter,
  440.         REFIID riid, LPVOID* ppv);
  441.     HRESULT GetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv);
  442. };
  443.  
  444. CString AFXAPI AfxStringFromCLSID(REFCLSID rclsid);
  445. BOOL AFXAPI AfxGetInProcServer(LPCTSTR lpszCLSID, CString& str);
  446. #endif // _AFX_NO_OLE_SUPPORT
  447. BOOL AFXAPI AfxResolveShortcut(CWnd* pWnd, LPCTSTR pszShortcutFile,
  448.     LPTSTR pszPath, int cchPath);
  449.  
  450. #define NULL_TLS ((DWORD)-1)
  451.  
  452. /////////////////////////////////////////////////////////////////////////////
  453. // Message map and message dispatch
  454.  
  455. const AFX_MSGMAP_ENTRY* AFXAPI
  456. AfxFindMessageEntry(const AFX_MSGMAP_ENTRY* lpEntry,
  457.     UINT nMsg, UINT nCode, UINT nID);
  458.  
  459. union MessageMapFunctions
  460. {
  461.     AFX_PMSG pfn;   // generic member function pointer
  462.  
  463.     // specific type safe variants for WM_COMMAND and WM_NOTIFY messages
  464.     void (AFX_MSG_CALL CCmdTarget::*pfn_COMMAND)();
  465.     BOOL (AFX_MSG_CALL CCmdTarget::*pfn_bCOMMAND)();
  466.     void (AFX_MSG_CALL CCmdTarget::*pfn_COMMAND_RANGE)(UINT);
  467.     BOOL (AFX_MSG_CALL CCmdTarget::*pfn_COMMAND_EX)(UINT);
  468.  
  469.     void (AFX_MSG_CALL CCmdTarget::*pfn_UPDATE_COMMAND_UI)(CCmdUI*);
  470.     void (AFX_MSG_CALL CCmdTarget::*pfn_UPDATE_COMMAND_UI_RANGE)(CCmdUI*, UINT);
  471.     void (AFX_MSG_CALL CCmdTarget::*pfn_OTHER)(void*);
  472.     BOOL (AFX_MSG_CALL CCmdTarget::*pfn_OTHER_EX)(void*);
  473.  
  474.     void (AFX_MSG_CALL CCmdTarget::*pfn_NOTIFY)(NMHDR*, LRESULT*);
  475.     BOOL (AFX_MSG_CALL CCmdTarget::*pfn_bNOTIFY)(NMHDR*, LRESULT*);
  476.     void (AFX_MSG_CALL CCmdTarget::*pfn_NOTIFY_RANGE)(UINT, NMHDR*, LRESULT*);
  477.     BOOL (AFX_MSG_CALL CCmdTarget::*pfn_NOTIFY_EX)(UINT, NMHDR*, LRESULT*);
  478.  
  479.     // type safe variant for thread messages
  480.  
  481.     void (AFX_MSG_CALL CWinThread::*pfn_THREAD)(WPARAM, LPARAM);
  482.  
  483.     // specific type safe variants for WM-style messages
  484.     BOOL    (AFX_MSG_CALL CWnd::*pfn_bD)(CDC*);
  485.     BOOL    (AFX_MSG_CALL CWnd::*pfn_bb)(BOOL);
  486.     BOOL    (AFX_MSG_CALL CWnd::*pfn_bWww)(CWnd*, UINT, UINT);
  487.     BOOL    (AFX_MSG_CALL CWnd::*pfn_bHELPINFO)(HELPINFO*);
  488.     BOOL    (AFX_MSG_CALL CWnd::*pfn_bWCDS)(CWnd*, COPYDATASTRUCT*);
  489.     HBRUSH  (AFX_MSG_CALL CWnd::*pfn_hDWw)(CDC*, CWnd*, UINT);
  490.     HBRUSH  (AFX_MSG_CALL CWnd::*pfn_hDw)(CDC*, UINT);
  491.     int     (AFX_MSG_CALL CWnd::*pfn_iwWw)(UINT, CWnd*, UINT);
  492.     int     (AFX_MSG_CALL CWnd::*pfn_iww)(UINT, UINT);
  493.     int     (AFX_MSG_CALL CWnd::*pfn_iWww)(CWnd*, UINT, UINT);
  494.     int     (AFX_MSG_CALL CWnd::*pfn_is)(LPTSTR);
  495.     LRESULT (AFX_MSG_CALL CWnd::*pfn_lwl)(WPARAM, LPARAM);
  496.     LRESULT (AFX_MSG_CALL CWnd::*pfn_lwwM)(UINT, UINT, CMenu*);
  497.     void    (AFX_MSG_CALL CWnd::*pfn_vv)(void);
  498.  
  499.     void    (AFX_MSG_CALL CWnd::*pfn_vw)(UINT);
  500.     void    (AFX_MSG_CALL CWnd::*pfn_vww)(UINT, UINT);
  501.     void    (AFX_MSG_CALL CWnd::*pfn_vvii)(int, int);
  502.     void    (AFX_MSG_CALL CWnd::*pfn_vwww)(UINT, UINT, UINT);
  503.     void    (AFX_MSG_CALL CWnd::*pfn_vwii)(UINT, int, int);
  504.     void    (AFX_MSG_CALL CWnd::*pfn_vwl)(WPARAM, LPARAM);
  505.     void    (AFX_MSG_CALL CWnd::*pfn_vbWW)(BOOL, CWnd*, CWnd*);
  506.     void    (AFX_MSG_CALL CWnd::*pfn_vD)(CDC*);
  507.     void    (AFX_MSG_CALL CWnd::*pfn_vM)(CMenu*);
  508.     void    (AFX_MSG_CALL CWnd::*pfn_vMwb)(CMenu*, UINT, BOOL);
  509.  
  510.     void    (AFX_MSG_CALL CWnd::*pfn_vW)(CWnd*);
  511.     void    (AFX_MSG_CALL CWnd::*pfn_vWww)(CWnd*, UINT, UINT);
  512.     void    (AFX_MSG_CALL CWnd::*pfn_vWp)(CWnd*, CPoint);
  513.     void    (AFX_MSG_CALL CWnd::*pfn_vWh)(CWnd*, HANDLE);
  514.     void    (AFX_MSG_CALL CWnd::*pfn_vwW)(UINT, CWnd*);
  515.     void    (AFX_MSG_CALL CWnd::*pfn_vwWb)(UINT, CWnd*, BOOL);
  516.     void    (AFX_MSG_CALL CWnd::*pfn_vwwW)(UINT, UINT, CWnd*);
  517.     void    (AFX_MSG_CALL CWnd::*pfn_vwwx)(UINT, UINT);
  518.     void    (AFX_MSG_CALL CWnd::*pfn_vs)(LPTSTR);
  519.     void    (AFX_MSG_CALL CWnd::*pfn_vOWNER)(int, LPTSTR);   // force return TRUE
  520.     int     (AFX_MSG_CALL CWnd::*pfn_iis)(int, LPTSTR);
  521.     UINT    (AFX_MSG_CALL CWnd::*pfn_wp)(CPoint);
  522.     UINT    (AFX_MSG_CALL CWnd::*pfn_wv)(void);
  523.     void    (AFX_MSG_CALL CWnd::*pfn_vPOS)(WINDOWPOS*);
  524.     void    (AFX_MSG_CALL CWnd::*pfn_vCALC)(BOOL, NCCALCSIZE_PARAMS*);
  525.     void    (AFX_MSG_CALL CWnd::*pfn_vwp)(UINT, CPoint);
  526.     void    (AFX_MSG_CALL CWnd::*pfn_vwwh)(UINT, UINT, HANDLE);
  527.     BOOL    (AFX_MSG_CALL CWnd::*pfn_bwsp)(UINT, short, CPoint);
  528.     void    (AFX_MSG_CALL CWnd::*pfn_vws)(UINT, LPCTSTR);
  529. };
  530.  
  531. CHandleMap* PASCAL afxMapHWND(BOOL bCreate = FALSE);
  532. CHandleMap* PASCAL afxMapHIMAGELIST(BOOL bCreate = FALSE);
  533. CHandleMap* PASCAL afxMapHDC(BOOL bCreate = FALSE);
  534. CHandleMap* PASCAL afxMapHGDIOBJ(BOOL bCreate = FALSE);
  535. CHandleMap* PASCAL afxMapHMENU(BOOL bCreate = FALSE);
  536.  
  537. /////////////////////////////////////////////////////////////////////////////
  538. // Debugging/Tracing helpers
  539.  
  540. #ifdef _DEBUG
  541.     void AFXAPI _AfxTraceMsg(LPCTSTR lpszPrefix, const MSG* pMsg);
  542.     BOOL AFXAPI _AfxCheckDialogTemplate(LPCTSTR lpszResource,
  543.         BOOL bInvisibleChild);
  544. #endif
  545.  
  546. /////////////////////////////////////////////////////////////////////////////
  547. // byte-swapping helpers
  548.  
  549. #ifdef _AFX_BYTESWAP
  550.  
  551. struct _AFXWORD
  552. {
  553.     BYTE WordBits[sizeof(WORD)];
  554. };
  555. struct _AFXDWORD
  556. {
  557.     BYTE DwordBits[sizeof(DWORD)];
  558. };
  559.  
  560. struct _AFXFLOAT
  561. {
  562.     BYTE FloatBits[sizeof(float)];
  563. };
  564. struct _AFXDOUBLE
  565. {
  566.     BYTE DoubleBits[sizeof(double)];
  567. };
  568.  
  569. inline void _AfxByteSwap(WORD w, BYTE* pb)
  570. {
  571.     _AFXWORD wAfx;
  572.     *(WORD*)&wAfx = w;
  573.  
  574.     ASSERT(sizeof(WORD) == 2);
  575.  
  576.     *pb++ = wAfx.WordBits[1];
  577.     *pb = wAfx.WordBits[0];
  578. }
  579.  
  580. inline void _AfxByteSwap(DWORD dw, BYTE* pb)
  581. {
  582.     _AFXDWORD dwAfx;
  583.     *(DWORD*)&dwAfx = dw;
  584.  
  585.     ASSERT(sizeof(DWORD) == 4);
  586.  
  587.     *pb++ = dwAfx.DwordBits[3];
  588.     *pb++ = dwAfx.DwordBits[2];
  589.     *pb++ = dwAfx.DwordBits[1];
  590.     *pb = dwAfx.DwordBits[0];
  591. }
  592.  
  593. inline void _AfxByteSwap(float f, BYTE* pb)
  594. {
  595.     _AFXFLOAT fAfx;
  596.     *(float*)&fAfx = f;
  597.  
  598.     ASSERT(sizeof(float) == 4);
  599.  
  600.     *pb++ = fAfx.FloatBits[3];
  601.     *pb++ = fAfx.FloatBits[2];
  602.     *pb++ = fAfx.FloatBits[1];
  603.     *pb = fAfx.FloatBits[0];
  604. }
  605.  
  606. inline void _AfxByteSwap(double d, BYTE* pb)
  607. {
  608.     _AFXDOUBLE dAfx;
  609.     *(double*)&dAfx = d;
  610.  
  611.     ASSERT(sizeof(double) == 8);
  612.  
  613.     *pb++ = dAfx.DoubleBits[7];
  614.     *pb++ = dAfx.DoubleBits[6];
  615.     *pb++ = dAfx.DoubleBits[5];
  616.     *pb++ = dAfx.DoubleBits[4];
  617.     *pb++ = dAfx.DoubleBits[3];
  618.     *pb++ = dAfx.DoubleBits[2];
  619.     *pb++ = dAfx.DoubleBits[1];
  620.     *pb = dAfx.DoubleBits[0];
  621. }
  622. #endif //_AFX_BYTESWAP
  623.  
  624. #undef AFX_DATA
  625. #define AFX_DATA
  626.  
  627. /////////////////////////////////////////////////////////////////////////////
  628.