The types of strings commonly used in Microsoft code are char *, wchar_t *, LPSTR, LPTSTR, LPWSTR, LPCSTR, LPCTSTR, LPCWSTR, BSTR, OLESTR, UNICODE_STRING, String, string, wstring, _bstr_t, CString
The last 5 classes. You choose the one that gives you the least headaches when converting, depending on which API you need to use:
- std :: string and wstring, C ++ standard library
- System :: String, the type of string for managed code
- _bstr_t, a wrapper for BSTR used in COM automation
- CString, a string type for ATL and MFC libraries.
When working with other APIs, you are likely to come across additional string types.
source share