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.

52 lines
683 B

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. BSTRING.H
  5. Abstract:
  6. History:
  7. --*/
  8. #ifndef _BSTRING_H_
  9. #define _BSTRING_H_
  10. class CBString
  11. {
  12. private:
  13. BSTR m_pString;
  14. public:
  15. CBString()
  16. {
  17. m_pString = NULL;
  18. }
  19. CBString(int nSize);
  20. CBString(WCHAR* pwszString);
  21. ~CBString();
  22. BSTR GetString()
  23. {
  24. return m_pString;
  25. }
  26. const CBString& operator=(LPWSTR pwszString)
  27. {
  28. if(m_pString) {
  29. SysFreeString(m_pString);
  30. }
  31. m_pString = SysAllocString(pwszString);
  32. return *this;
  33. }
  34. };
  35. #endif // _BSTRING_H_