cmdriver/src/CMDriver.cxx
///////////////////////////////////////////////////////////////////////
// OutputError
// OutputError the error number and corresponding message.
///////////////////////////////////////////////////////////////////////
OutputError
OutputError the error number and corresponding message.
OutputError OutputError the error number and corresponding message .
DWORD OutputError(char** pszOutputBuffer, char *pszAPI)
{
    char* lpMsgBuf;
    static char* pcOutputFormat="ERROR: API    = %s.\n   message    = %s.\n"; 
    DWORD dwError = GetLastError();
    FormatMessage(
                  FORMAT_MESSAGE_ALLOCATE_BUFFER |
                  FORMAT_MESSAGE_FROM_SYSTEM |
                  FORMAT_MESSAGE_IGNORE_INSERTS,
                  NULL,
                  dwError,
                  0, 
                  (LPTSTR) &lpMsgBuf,
                  0,
                  NULL
                  );
    int nLen = strlen(lpMsgBuf)+strlen(pcOutputFormat)+strlen(pszAPI)+1;
    *pszOutputBuffer = new char[nLen];
    sprintf(*pszOutputBuffer, pcOutputFormat, pszAPI, lpMsgBuf);
    LocalFree( lpMsgBuf );
    return dwError;
}
DWORD OutputError ( char * * pszOutputBuffer , char * pszAPI ) { char * lpMsgBuf ; static char * pcOutputFormat = " \n \n " ; DWORD dwError = GetLastError ( ) ; FormatMessage ( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS , NULL , dwError , 0 , ( LPTSTR ) & lpMsgBuf , 0 , NULL ) ; int nLen = strlen ( lpMsgBuf ) + strlen ( pcOutputFormat ) + strlen ( pszAPI ) + 1 ; * pszOutputBuffer = new char [ nLen ] ; sprintf ( * pszOutputBuffer , pcOutputFormat , pszAPI , lpMsgBuf ) ; LocalFree ( lpMsgBuf ) ; return dwError ; }
OutputError
OutputError the error number and corresponding message.
OutputError OutputError the error number and corresponding message .
// Default language // Free the buffer.