Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

GetLastError()?

May
12,939
171
In general, will I get accurate results calling GetLastError() after a TCC/SDK API fails?

In particular, how about AllocMem()? ... as in

Code:
LPVOID p = AllocMem(size);
if ( p == NULL )
    return error(GetLastError(), L"AllocMem");
 
> In general, will I get accurate results calling GetLastError() after a
> TCC/SDK API fails?

In general, but not for APIs that don't call Windows, and not for APIs that
call Windows but then call another Windows API after the first one fails.


> In particular, how about AllocMem()? ... as in

But not for AllocMem(), which doesn't call Windows (except for the first
allocation).

The only way AllocMem() will fail is if Windows is out of memory.

Rex Conn
JP Software
 
Back
Top