What the difference between LPCSTR, LPCTSTR and LPTSTR?
Why do we need to do this to convert a string into a LV_ITEM structure variable pszText:
LV_DISPINFO dispinfo;
dispinfo.item.pszText = LPTSTR((LPCTSTR)string);
What the difference between LPCSTR, LPCTSTR and LPTSTR?
Why do we need to do this to convert a string into a LV_ITEM structure variable pszText:
LV_DISPINFO dispinfo;
dispinfo.item.pszText = LPTSTR((LPCTSTR)string);
quick and dirty:
LP == long pointer. Just think pointer or char*
C = const in this case i think they mean the character string is a const, not the pointer being const.
STR is string
the T is for a wide character or char (TCHAR) depending on compile options.
To answer the first part of your question:
LPCSTR is a const string
LPCTSTR is a const TCHAR string, (TCHAR being either a wide char or char depending on whether UNICODE is defined)
LPTSTR is a (non-const) TCHAR string
This is a great codeproject article describing C++ strings (see 2/3 the way down for a chart comparing the different types)
Adding to John and Tim's answer.
Unless you are coding on Win98, there are only two of the 6+ string types you should be using in your application
The rest are meant to support ANSI platforms or dual compiles. Those are not as relevant today as they used to be.