DAPI_EVENT

The DAPI_EVENT structure contains information about errors that are encountered during the execution of a DAPI function.

Quick Info

Header file: DAPI.H
Unicode: Yes

typedef struct _DAPI_EVENT
{
  DWORD               dwDAPIError;
  LPSTR               rgpszSubst[DAPI_MAX_SUBST];
  UINT                unSubst;
  LPSTR               pszAttribute
  LPSTR               pszHoldLine;
  HINSTANCE           hinstDAPI
  struct _DAPI_EVENT  *pNextEvent
}  DAPI_EVENT, * PDAPI_EVENT;
 

Members

dwDapiError
Message identifier for the event log.
rgpszSubst[DAPI_MAX_SUBST]
Event message substitution array.
unSubst
The number of substitution strings in rgpscSubst[].
pszAttribute
The name of the attribute containing an error. Note: May be NULL on some errors.
pszHoldLine
Points to a buffer that contains a copy of the line containing the error.
hinstDAPI
Instance handle of DAPI.DLL.
pNextEvent
Points to the next event describing another error encountered. This member is NULL for the last error.

Remarks

The DAPI_EVENT structure is returned by the DAPIRead, DAPIStart, and DAPIWrite functions, and passed to error callback functions invoked by the BatchExport, BatchImport, NTExport, and NWExport functions.

Call the WIN32 FormatMessage function to obtain a localized string containing the substitution strings corresponding to the error code. You can then display this information to the user in a dialog box. The messages, which are also string resources, are located in the module DAPI.DLL.

For additional information on this structure, see Using Directory Access Functions. For an example of how to utilize the information that is returned in a DAPI_EVENT structure by a directory function, see the DAPIStart and DAPIWrite function calls in the DIRSYNC.C code sample.

See Also

BatchExport, BatchImport, DAPIRead, DAPIStart, DAPIWrite, NTExport, NWExport