Friday, June 12, 2009

C++ Acronyms / Windows API

[Acronym] ([Description]) - [Equivalent to]
LPSTR (Long Pointer to STRing) - char*
LPCSTR (Long Pointer to Constant STRing) - const char*
LPWSTR (Long Pointer to Wide STRing) - wchar_t*
LPCWSTR (Long Pointer to Constant Wide STRing) - const wchar_t*
LPTSTR (Long Pointer to a null-Terminated STRing) - TCHAR*
LPCTSTR (Long Pointer to a Constant null-Terminated STRing) - const TCHAR*

The above acronyms can commonly be seen in Windows API programming. The above 6 acronyms will define the respective data types without 'Long', when 'L' is omitted. For eg. PSTR denotes Pointer to string.


  1. It's interesting that the Windows API redefines many types, often taking on more Pascal-ish wording: BYTE, WORD, and DWORD (like Pascal does, instead of unsingned (long|short) int).

  2. yes Keith, I too found it very interesting when I first learned Windows API programming. :)


Relevant comments and feedback are always encouraged.

Comments with spam links to random web sites and services are deleted, to maintain the quality and relevance of the forum. If you are rather interested in advertising in this blog, feel free to send a message to the blog administrator.

Thank you.