home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / mfc / include / afxconv.h < prev    next >
C/C++ Source or Header  |  1998-06-16  |  2KB  |  65 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. #ifndef __AFXCONV_H__
  12. #define __AFXCONV_H__
  13.  
  14. #ifndef _OBJBASE_H_
  15. #include <objbase.h>
  16. #endif
  17.  
  18. /////////////////////////////////////////////////////////////////////////////
  19. // Global UNICODE<>ANSI translation helpers
  20.  
  21. #ifdef _WINGDI_
  22. LPDEVMODEW AFXAPI AfxDevModeA2W(LPDEVMODEW lpDevModeW, LPDEVMODEA lpDevModeA);
  23. LPDEVMODEA AFXAPI AfxDevModeW2A(LPDEVMODEA lpDevModeA, LPDEVMODEW lpDevModeW);
  24. LPTEXTMETRICW AFXAPI AfxTextMetricA2W(LPTEXTMETRICW lptmW, LPTEXTMETRICA lptmA);
  25. LPTEXTMETRICA AFXAPI AfxTextMetricW2A(LPTEXTMETRICA lptmA, LPTEXTMETRICW lptmW);
  26.  
  27. #ifndef ATLDEVMODEA2W
  28. #define ATLDEVMODEA2W AfxDevModeA2W
  29. #define ATLDEVMODEW2A AfxDevModeW2A
  30. #define ATLTEXTMETRICA2W AfxTextMetricA2W
  31. #define ATLTEXTMETRICW2A AfxTextMetricW2A
  32. #endif
  33.  
  34. #endif //_WINGDI
  35.  
  36. LPWSTR AFXAPI AfxA2WHelper(LPWSTR lpw, LPCSTR lpa, int nChars);
  37. LPSTR AFXAPI AfxW2AHelper(LPSTR lpa, LPCWSTR lpw, int nChars);
  38.  
  39. #ifndef ATLA2WHELPER
  40. #define ATLA2WHELPER AfxA2WHelper
  41. #define ATLW2AHELPER AfxW2AHelper
  42. #endif
  43.  
  44. #define OLESTDDELIMOLE OLESTR("\\")
  45.  
  46. #if defined(_UNICODE)
  47. // in these cases the default (TCHAR) is the same as OLECHAR
  48.     AFX_INLINE LPOLESTR TASKSTRINGT2OLE(LPOLESTR lp) { return lp; }
  49.     AFX_INLINE LPTSTR TASKSTRINGOLE2T(LPOLESTR lp) { return lp; }
  50.     AFX_INLINE BSTR BSTR2TBSTR(BSTR bstr) { return bstr;}
  51. #elif defined(OLE2ANSI)
  52. // in these cases the default (TCHAR) is the same as OLECHAR
  53.     AFX_INLINE LPOLESTR TASKSTRINGT2OLE(LPOLESTR lp) { return lp; }
  54.     AFX_INLINE LPTSTR TASKSTRINGOLE2T(LPOLESTR lp) { return lp; }
  55.     AFX_INLINE BSTR BSTR2TBSTR(BSTR bstr) { return bstr; }
  56. #else
  57.     #define TASKSTRINGT2OLE(lpa)    AfxTaskStringA2W(lpa)
  58.     #define TASKSTRINGOLE2T(lpo) AfxTaskStringW2A(lpo)
  59.     #define BSTR2TBSTR(bstr) AfxBSTR2ABSTR(bstr)
  60. #endif
  61.  
  62. #include <atlconv.h>
  63.  
  64. #endif //__AFXCONV_H__
  65.