생성된 마지막 예외에 대한 진단 정보를 가져옵니다. 현재 스레드에서 생성된 마지막 예외에 대한 정보가 CCI_EXCEPTION_ST 출력 구조로 리턴됩니다. 사용자 정의 확장 구성요소는 이 함수를 사용하여 유틸리티 함수가 오류 코드를 리턴할 때 복구가 필요한지 여부를 판별합니다.
유틸리티 함수가 returnCode를 CCI_EXCEPTION으로 설정하여 예외가 발생했음을 알린 경우 이 함수가 호출됩니다.
char*이 US-ASCII인 경우 예외와 연관된 traceText가 char*로 변환됩니다. traceText가 다른 언어로 되어 있는 경우 traceText를 UTF-16으로 저장하는 cciGetLastExceptionDataW 및 연관된 CCI_EXCEPTION_WIDE_ST 구조를 사용하십시오.
브로커 또는 cciThrowExceptionW에 의해 예외가 발생하면 CCI_EXCEPTION_ST 구조의 traceText 요소가 빈 문자열이 됩니다.
typedef struct exception_st { int versionId; /* Structure version identification */ int type; /* Type of exception */ int messageNumber; /* Message number */ int insertCount; /* Number of message inserts */ CCI_STRING_ST inserts[CCI_MAX_EXCEPTION_INSERTS]; /* Array of message insert areas */ const char* fileName; /* Source: file name */ int lineNumber; /* Source: line number in file */ const char* functionName; /* Source: function name */ const char* traceText; /* Trace text associated with exception */ CCI_STRING_ST objectName; /* Object name */ CCI_STRING_ST objectType; /* Object type */ } CCI_EXCEPTION_ST; CCI_EXCEPTION_ST exception_st = malloc(sizeof(CCI_EXCEPTION_ST)); int rc = 0; memset(&exception_st,0,sizeof(exception_st)); cciGetLastExceptionData(&rc, &exception_st);