vefatica May 12,949 172 Jul 28, 2010 #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,074 195 Staff member Jul 28, 2010 #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