This structure is returned by PDF export functions to indicate whether they were successful, and if they failed to give the reason why.
typedef struct
{
KVErrorCode eErrorCode;
KVErrorCodeEx eErrorCodeEx;
}
KVPDFState; eErrorCode | The error code returned by KeyView. This enumerated type is defined in kverrorcodes.h. |
eErrorCodeEx | The extended error code returned by KeyView. This enumerated type is defined in kverrorcodes.h. |
To evaluate a KVPDFState object, check eErrorCode first. A value of KVERR_Success (0) indicates success. Any other value indicates failure.
You can ignore eErrorCodeEx unless eErrorCode is KVERR_General. In this case, eKVErrorCodeEx might contain an extended error code that gives more information. If no more detail is available, eKVErrorCodeEx is set to 0.
In this example, a state object is used to obtain the error code as an integer.
int convertStateToError(const KVPDFState state)
{
if (state.eErrorCode == KVERR_General && state.eErrorCodeEx != (KVErrorCodeEx)0)
{
return state.eErrorCodeEx;
}
return state.eErrorCode;
}