#if !defined (_UTILITY_H_) #define _UTILITY_H_ //....................................................................................................................... // Utility functions //....................................................................................................................... //....................................................................................................................... // Function prototypes //....................................................................................................................... L_INT GetItemIndex ( L_INT* pnTable, L_INT nItem ) ; L_BOOL UpdataIfValid ( HWND hdlg, L_INT nItemID, L_INT nMin, L_INT nMax, L_INT* nDestVar, L_BOOL bSigned ) ; L_BOOL DoChooseFont ( HWND hdlg, LPLOGFONT plogFont ) ; COLORREF DoChooseColor ( COLORREF crCurrentColor ) ; LPCTSTR GetAppName ( ) ; LPCTSTR GetHelpFileName ( ) ; L_BOOL CenterWindow ( HWND hwndCentered, HWND hwndPreferredOwner ) ; #define DIM(a) (sizeof(a)/sizeof(a[0])) //....................................................................................................................... // Diagnostic functions //....................................................................................................................... #ifdef _DEBUG //....................................................................................................................... // Function prototypes //....................................................................................................................... L_BOOL assertFailedOnLine ( LPCSTR lpszFileName, L_INT nLine ) ; #define THIS_FILE __FILE__ #define ASSERT(f) { if (!(f) && assertFailedOnLine (THIS_FILE, __LINE__)) { FatalExit (0); } } #define VERIFY(f) ASSERT(f) #else // _DEBUG #define ASSERT(f) ((L_VOID)0) #define VERIFY(f) ((L_VOID)(f)) #endif // !_DEBUG #endif // _UTILITY_H_