Partager via


EXCEPINFO (Compact 2013)

3/26/2014

This structure describes an exception that occurred during IDispatch::Invoke.

Syntax

typedef struct FARSTRUCT tagEXCEPINFO {
  unsigned short wCode;
  unsigned short wReserved;
  BSTR bstrSource;
  BSTR bstrDescription;
  BSTR bstrHelpFile;
  unsigned long dwHelpContext;
  void FAR *pvReserved;
  HRESULT (STDAPICALLTYPE FAR* pfnDeferredFillIn) 
          (struct tagEXCEPINFO FAR *);
  SCODE scode;
} EXCEPINFO;

Members

  • wCode
    Code that identifies the error. Error codes should be greater than 1000. This member is required.
  • wReserved
    Reserved; set to 0.
  • bstrSource
    Unicode string that contains the textual, human-readable name of the source of the exception. Typically, this is an application name. This member should be filled in by the implementer of IDispatch.
  • bstrDescription
    Unicode string that contains the textual, human-readable description of the error intended for the customer. If no description is available, use NULL.
  • bstrHelpFile
    Unicode string that contains the fully qualified drive, path, and file name of a Help file with more information about the error. If no Help is available, use NULL.
  • dwHelpContext
    Specifies the Help context identifier of the topic within the Help file. This member should be filled in if and only if the bstrHelpFile member is not NULL.
  • pvReserved
    Reserved; set to NULL.
  • pfnDeferredFillIn
    Pointer to a function that takes an EXCEPINFO structure as an argument and returns an HRESULT value. Pass NULL to not use deferred fill-in of the EXCEPINFO structure. For more information, see Remarks.
  • scode
    Must be set to 0. Not used. A legacy remnant from the 16-bit Windows API.

Remarks

Use the pfnDeferredFillIn member to allow an object to defer filling in the bstrDescription, bstrHelpFile, and dwHelpContext members until they are needed. This member might be used, for example, if loading the string for the error is a time-consuming operation. To use deferred fill-in, the object puts a function pointer in this slot and does not fill any of the other members except wCode, which is required.

To get additional information, the caller passes the EXCEPINFO structure back to the pexcepinfo callback function, which fills in the additional information. When the ActiveX object and the ActiveX client are in different processes, the ActiveX object calls pfnDeferredFillIn before returning to the controller.

Requirements

Header

oaidl.h

See Also

Reference

Automation Structures
IDispatch::Invoke