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.

58 lines
884 B

  1. //***************************************************************************
  2. //
  3. // File:
  4. //
  5. // Module: MS SNMP Provider
  6. //
  7. // Purpose:
  8. //
  9. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  10. //
  11. //***************************************************************************
  12. #ifndef _BSTRING_H_
  13. #define _BSTRING_H_
  14. class CBString
  15. {
  16. private:
  17. BSTR m_pString;
  18. public:
  19. CBString()
  20. {
  21. m_pString = NULL;
  22. }
  23. CBString(int nSize);
  24. CBString(WCHAR* pwszString);
  25. ~CBString();
  26. BSTR GetString()
  27. {
  28. return m_pString;
  29. }
  30. const CBString& operator=(LPWSTR pwszString)
  31. {
  32. if(m_pString) {
  33. SysFreeString(m_pString);
  34. }
  35. m_pString = SysAllocString(pwszString);
  36. return *this;
  37. }
  38. };
  39. #endif // _BSTRING_H_