Source code of Windows XP (NT5)
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.

64 lines
2.1 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. #ifndef __AFXCONV_H__
  11. #define __AFXCONV_H__
  12. #ifndef _OBJBASE_H_
  13. #include <objbase.h>
  14. #endif
  15. /////////////////////////////////////////////////////////////////////////////
  16. // Global UNICODE<>ANSI translation helpers
  17. #ifdef _WINGDI_
  18. LPDEVMODEW AFXAPI AfxDevModeA2W(LPDEVMODEW lpDevModeW, LPDEVMODEA lpDevModeA);
  19. LPDEVMODEA AFXAPI AfxDevModeW2A(LPDEVMODEA lpDevModeA, LPDEVMODEW lpDevModeW);
  20. LPTEXTMETRICW AFXAPI AfxTextMetricA2W(LPTEXTMETRICW lptmW, LPTEXTMETRICA lptmA);
  21. LPTEXTMETRICA AFXAPI AfxTextMetricW2A(LPTEXTMETRICA lptmA, LPTEXTMETRICW lptmW);
  22. #ifndef ATLDEVMODEA2W
  23. #define ATLDEVMODEA2W AfxDevModeA2W
  24. #define ATLDEVMODEW2A AfxDevModeW2A
  25. #define ATLTEXTMETRICA2W AfxTextMetricA2W
  26. #define ATLTEXTMETRICW2A AfxTextMetricW2A
  27. #endif
  28. #endif //_WINGDI
  29. LPWSTR AFXAPI AfxA2WHelper(LPWSTR lpw, LPCSTR lpa, int nChars);
  30. LPSTR AFXAPI AfxW2AHelper(LPSTR lpa, LPCWSTR lpw, int nChars);
  31. #ifndef ATLA2WHELPER
  32. #define ATLA2WHELPER AfxA2WHelper
  33. #define ATLW2AHELPER AfxW2AHelper
  34. #endif
  35. #define OLESTDDELIMOLE OLESTR("\\")
  36. #if defined(_UNICODE)
  37. // in these cases the default (TCHAR) is the same as OLECHAR
  38. AFX_INLINE LPOLESTR TASKSTRINGT2OLE(LPOLESTR lp) { return lp; }
  39. AFX_INLINE LPTSTR TASKSTRINGOLE2T(LPOLESTR lp) { return lp; }
  40. AFX_INLINE BSTR BSTR2TBSTR(BSTR bstr) { return bstr;}
  41. #elif defined(OLE2ANSI)
  42. // in these cases the default (TCHAR) is the same as OLECHAR
  43. AFX_INLINE LPOLESTR TASKSTRINGT2OLE(LPOLESTR lp) { return lp; }
  44. AFX_INLINE LPTSTR TASKSTRINGOLE2T(LPOLESTR lp) { return lp; }
  45. AFX_INLINE BSTR BSTR2TBSTR(BSTR bstr) { return bstr; }
  46. #else
  47. #define TASKSTRINGT2OLE(lpa) AfxTaskStringA2W(lpa)
  48. #define TASKSTRINGOLE2T(lpo) AfxTaskStringW2A(lpo)
  49. #define BSTR2TBSTR(bstr) AfxBSTR2ABSTR(bstr)
  50. #endif
  51. #include <atlconv.h>
  52. #endif //__AFXCONV_H__