Export (0) Print
Expand All

EXCEPINFO Data Type

Describes an exception that occurred during IDispatch::Invoke. For more information about exceptions, see IDispatch::Invoke and Dispatch Interface and API Functions.

typedef struct FARSTRUCT tagEXCEPINFO
   {
   unsigned short wCode;                      // Error code.
   Unsigned short wReserved;                  // Reserved.
   BSTR bstrSource;                           // Exception source.
   BSTR bstrDescription;                      // Exception description.
   BSTR bstrHelpFile;                         // Help file path.
   Unsigned long dwHelpContext;               // Help context ID.
   Void FAR* pvReserved;                      // Reserved.
   HRESULT (STDAPICALLTYPE FAR* pfnDeferredFillIn) // Pointer to a
         (struct tagEXCEPINFO FAR*);               // function that
                                                   // fills in help and
                                                   // description info.
   SCODE scode;                               // Return value.
   } EXCEPINFO, FAR* LPEXCEPINFO;
 

The following table describes the fields of the EXCEPINFO structure.

Field name

Type

Description

wCode

unsigned short

An error code identifying the error. Error codes should be greater than 1000. Either this field or the scode field must be filled in; the other must be set to 0.

WReserved

unsigned short

Reserved; should be set to 0.

BstrSource

BSTR

A textual, human-readable name of the source of the exception. Typically, this is an application name. This field should be filled in by the implementor of IDispatch.

BstrDescription

BSTR

A textual, human-readable description of the error intended for the customer. If no description is available, use Null.

BstrHelpFile

BSTR

The fully qualified drive, path, and file name of a Help file that has more information about the error. If no Help is available, use Null.

DwHelpContext

unsigned long

The Help context ID of the topic in the Help file. This field should be filled in if and only if the bstrHelpFile field is not Null.

PvReserved

void FAR*

Must be set to Null.

PfnDeferredFillIn

STDAPICALLTYPE

Pointer to a function that takes an EXCEPINFO structure as an argument and returns an HRESULT value. If deferred, fill-in is not desired, this field should be set to Null.

scode

SCODE

A return value that describes the error. Either this field or wCode (but not both) must be filled in; the other must be set to 0. (16-bit Windows versions only.)

Use the pfnDeferredFillIn field to enable an object to defer filling in the bstrDescription, bstrHelpFile, and dwHelpContext fields until they are needed. This field 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 fields 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.

Show:
© 2014 Microsoft