Win32
In the world of Win32, integer values were used to indicate errors produced by functions. This already introduces a problem: The meaning of a plain old integer is not very clear by just looking at it. Instead, symbolic constants need to be introduced to make program code look more meaningful. Although the error checks might be apparent during development, the magic error constants do not offer much information during debugging. Furthermore, those error codes need to be queried for after failed function calls using the GetLastError function. An example of such a function call, followed by error “handling,” is shown here:
HWND hWindow = CreateWindowEx(0, g_szClassName, L"Hello Win32", WS_OVERLAPPEDWINDOW, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access