如题

解决方案 »

  1.   

    SysErrorMessage函数是干什么的?详细功能!
      

  2.   

    DWORD FormatMessage(
      DWORD dwFlags,      // source and processing options
      LPCVOID lpSource,   // pointer to  message source
      DWORD dwMessageId,  // requested message identifier
      DWORD dwLanguageId, // language identifier for requested message
      LPTSTR lpBuffer,    // pointer to message buffer
      DWORD nSize,        // maximum size of message buffer
      va_list *Arguments  // pointer to array of message inserts
    );
      

  3.   

    这个看看
    void GetError()
    {
    LPTSTR lpMsgBuf;
    unsigned long i;
    FormatMessage( 
    FORMAT_MESSAGE_ALLOCATE_BUFFER | 
    FORMAT_MESSAGE_FROM_SYSTEM | 
    FORMAT_MESSAGE_IGNORE_INSERTS,
    NULL,
    i = GetLastError(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
    (LPTSTR) &lpMsgBuf,
    0,
    NULL 
    );
    MessageBox(NULL,lpMsgBuf,"ERROR",MB_OK);
    LocalFree( lpMsgBuf );
    }