1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

GetLastError()?

Discussion in 'Plugins' started by vefatica, Jul 28, 2010.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,885
    Likes Received:
    29
    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");
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,808
    Likes Received:
    82
    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.


    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
     

Share This Page