This class provides automatic resource cleanup for GetBuffer and ReleaseBuffer calls on an existing CStringT object.
The character type of the CStrBufT class. Can be one of the following:
char (for ANSI character strings)
wchar_t (for Unicode character strings)
TCHAR (for both ANSI and Unicode character strings)
Primarily designed as a helper class, CStrBufT provides a convenient way for a developer to work with the character buffer of a string object without worrying about how or when to call ReleaseBuffer. This is possible because the wrapper object goes out of scope naturally in the case of an exception or multiple exiting code paths; causing its destructor to free the string resource.