c00000fd
c00000fd

Reputation: 22265

Do Windows GDI APIs return error code in GetLastError?

I know it's an old technology, but I'm curious, do Windows GDI APIs return error codes in GetLastError()? I have several instances when DeleteObject and DeleteDC fail but error code is returned as 0.

Upvotes: 0

Views: 1093

Answers (2)

Remy Lebeau
Remy Lebeau

Reputation: 596101

Most GDI functions do not use GetLastError(). GDI functions that are capable of reporting specific errors will return error codes directly in their return values. Not all GDI functions can report specific errors, though.

Upvotes: 2

Gunner
Gunner

Reputation: 5884

A quick glance in the PSDK:

DeleteObject and DeleteDC:

Return Values - If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Windows NT/2000/XP: To get extended error information, call GetLastError.

The PSDK/MSDN is your friend.

Upvotes: 0

Related Questions