O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required