vefatica May 13,748 209 2010-07-28 #1 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 particular, how about AllocMem()? ... as in Code: LPVOID p = AllocMem(size); if ( p == NULL ) return error(GetLastError(), L"AllocMem");
rconn Administrator May 13,647 253 Staff member 2010-07-28 #2 > In general, will I get accurate results calling GetLastError() after a > TCC/SDK API fails? Click to expand... 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 Click to expand... 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
> In general, will I get accurate results calling GetLastError() after a > TCC/SDK API fails? Click to expand... 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 Click to expand... 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