BUG: GetErrorInfo() Returns Bad Pointer

ID: Q184885

The information in this article applies to:

SYMPTOMS

When you call GetErrorInfo(), it returns S_OK but the pointer returned in the out parameter, IErrorInfo **pperrinfo, is invalid. When you try to make a method call through this pointer, it may result in an access violation.

CAUSE

GetErrorInfo() was not completely implemented, which causes the bad pointer to be returned.

RESOLUTION

For Windows CE 2.0 and earlier, rich error information through IErrorInfo is not available. Use the HRESULT returned from the automation method call to understand why the call failed. For Windows CE 2.1 and later, IErrorInfo, Get/SetErrorInfo() are implemented and can be used.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem has been resolved in Windows CE version 2.1 and later.

MORE INFORMATION

Steps to Reproduce Behavior

The following code fragment fails on Windows CE 2.0 when pei->GetDescription() is called:

   BSTR bstrError = 0;
   IErrorInfo* pei;
   if (SUCCEEDED(GetErrorInfo(0, &pei)))
   {
      if (pei)
      {
         if (SUCCEEDED(pei->GetDescription(&bstrError)))
         {
            pei->Release();
         }
      }
   }

Additional query words: SetErrorInfo IErrorInfo COM
Keywords          : kbnokeyword kbWinCE 
Version           : WinCE:1.0,1.01,2.0,2.1
Issue type        : kbbug

Last Reviewed: July 3, 1998