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.

70 lines
1.8 KiB

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