Step Into Labs

Step Into C · Lesson 23 · Windows C

Errors & Handles

GetLastError and FormatMessage, the two "invalid handle" values, HRESULT, and handle lifetimes.

Part of Step Into C. The full lesson, its missions and the real compiler and debugger are in the course. Try a free lesson first to see how it works.

Win32 grew over 30 years, and different parts report errors differently:

In this lesson

Missions

  1. Explain an error
  2. NULL or INVALID_HANDLE_VALUE?
  3. Take an HRESULT apart
  4. One object, two handles