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.

68 lines
1.9 KiB

  1. //******************************************************************************
  2. //
  3. // StringHelp.h: Microsoft LocStudio
  4. //
  5. // Copyright (C) 1996-1997 by Microsoft Corporation.
  6. // All rights reserved.
  7. //
  8. //******************************************************************************
  9. #if !defined(LOCUTIL__StringHelp_h__INCLUDED)
  10. #define LOCUTIL__StringHelp_h__INCLUDED
  11. //------------------------------------------------------------------------------
  12. class LTAPIENTRY CStringHelp
  13. {
  14. // Enums
  15. public:
  16. enum Mode
  17. {
  18. mDisplay, // Use display-mode logic
  19. mEdit // Use edit-mode logic
  20. };
  21. // Construction
  22. public:
  23. CStringHelp(Mode mode, CReport * pReport);
  24. // Data
  25. protected:
  26. Mode m_mode;
  27. CReport * m_pReport;
  28. int m_cErrors;
  29. CLString m_stContext;
  30. BOOL m_fFirstErrorSet;
  31. CWnd const * m_pwndError; // Optional window of first error
  32. int m_idxError; // Optional index of first error
  33. // Attributes
  34. public:
  35. int GetErrorCount();
  36. void ResetErrorCount();
  37. const CLString & GetContext();
  38. void SetContext(const CLString & stContext);
  39. BOOL GetFirstError(CWnd const * & pwnd, int & idxError);
  40. // Operations
  41. public:
  42. void LoadString(const CPascalString & pasSrc, CLString & stDest);
  43. void LoadString(_bstr_t bstrSrc, CLString & stDest);
  44. void LoadString(const CPascalString & pasSrc, CEdit * pebc);
  45. void LoadString(_bstr_t bstrSrc, CEdit * pebc);
  46. BOOL SaveString(const CLString & stSrc, CPascalString & pasDest);
  47. BOOL SaveString(const CLString & stSrc, _bstr_t & bstrDest);
  48. BOOL SaveString(CEdit const * const pebc, CPascalString & pasDest);
  49. BOOL SaveString(CEdit const * const pebc, _bstr_t & bstrDest);
  50. // Implementation
  51. protected:
  52. void SetError(CWnd const * pwnd, int idxError);
  53. BOOL SaveString(const CLString & stSrc, CPascalString & pasDest, CWnd const * pwnd);
  54. BOOL SaveString(const CLString & stSrc, _bstr_t & bstrDest, CWnd const * pwnd);
  55. };
  56. #endif // LOCUTIL__StringHelp_h__INCLUDED