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.

2 comments:

  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).

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

    ReplyDelete