#if defined (_MT) || defined (_DLL)
# define ExceptionPtr ((long **)__pxcptinfoptrs())
#else
# define ExceptionPtr ((long *)_pxcptinfoptrs)
#endif#if defined (_MT) || defined (_DLL)
#define LogExceptionAny(whereFile, whereLine) {\
char buff[256] = { 0 };\
strcpy(buff, "Catch Exception ");\
char bufftemp[256] = { 0 };\
if ( *(ExceptionPtr) ) {\
(void)sprintf(bufftemp,"P0: %08x ", (**(ExceptionPtr)) );\
strncat (buff, bufftemp, strlen(bufftemp));\
memset(bufftemp, 0, sizeof(bufftemp)); }\
if ( *(ExceptionPtr+1) ) {\
(void)sprintf(bufftemp,"P1: %08x ", (**(ExceptionPtr+1)) );\
strncat (buff, bufftemp, strlen(bufftemp));\
memset(bufftemp, 0, sizeof(bufftemp)); }\
if (*(ExceptionPtr+2)) {\
(void)sprintf(bufftemp,"P2: %08x ", (**(ExceptionPtr+2)) );\
strncat (buff, bufftemp, strlen(bufftemp));\
memset(bufftemp, 0, sizeof(bufftemp)); }\
if ( *(ExceptionPtr+3) ) {\
(void)sprintf(bufftemp,"P3: %08x ", (**(ExceptionPtr+3)) );\
strncat (buff, bufftemp, strlen(bufftemp));\
memset(bufftemp, 0, sizeof(bufftemp)); }\
if ( *(ExceptionPtr+4) ) {\
(void)sprintf(bufftemp,"P4: %08x ", (**(ExceptionPtr+4)) );\
strncat (buff, bufftemp, strlen(bufftemp));\
memset(bufftemp, 0, sizeof(bufftemp)); }\
if ( *(ExceptionPtr+5) ) {\
(void)sprintf(bufftemp,"P5: %08x ", (**(ExceptionPtr+5)) );\
strncat (buff, bufftemp, strlen(bufftemp));\
memset(bufftemp, 0, sizeof(bufftemp)); }\
if ( *(ExceptionPtr+6) ) {\
(void)sprintf(bufftemp,"P6: %08x ", (**(ExceptionPtr+6)) );\
strncat (buff, bufftemp, strlen(bufftemp)); }\
__LogException(buff,whereFile,whereLine);\
}#else

解决方案 »

  1.   

    重新贴
    #if defined (_MT) || defined (_DLL)
    # define ExceptionPtr ((long **)__pxcptinfoptrs())
    #endif#if defined (_MT) || defined (_DLL)
    #define LogExceptionAny(whereFile, whereLine) {\
        char buff[256] = { 0 };\
        strcpy(buff, "Catch Exception ");\
        char bufftemp[256] = { 0 };\
        if ( *(ExceptionPtr) ) {\
         (void)sprintf(bufftemp,"P0: %08x ", (**(ExceptionPtr)) );\
         strncat (buff, bufftemp, strlen(bufftemp));\
         memset(bufftemp, 0, sizeof(bufftemp)); }\
        if ( *(ExceptionPtr+1) ) {\
         (void)sprintf(bufftemp,"P1: %08x ", (**(ExceptionPtr+1)) );\
         strncat (buff, bufftemp, strlen(bufftemp));\
         memset(bufftemp, 0, sizeof(bufftemp)); }\
        if (*(ExceptionPtr+2)) {\
         (void)sprintf(bufftemp,"P2: %08x ", (**(ExceptionPtr+2)) );\
         strncat (buff, bufftemp, strlen(bufftemp));\
         memset(bufftemp, 0, sizeof(bufftemp)); }\
        if ( *(ExceptionPtr+3) ) {\
         (void)sprintf(bufftemp,"P3: %08x ", (**(ExceptionPtr+3)) );\
         strncat (buff, bufftemp, strlen(bufftemp));\
         memset(bufftemp, 0, sizeof(bufftemp)); }\
        if ( *(ExceptionPtr+4) ) {\
         (void)sprintf(bufftemp,"P4: %08x ", (**(ExceptionPtr+4)) );\
         strncat (buff, bufftemp, strlen(bufftemp));\
         memset(bufftemp, 0, sizeof(bufftemp)); }\
        if ( *(ExceptionPtr+5) ) {\
         (void)sprintf(bufftemp,"P5: %08x ", (**(ExceptionPtr+5)) );\
         strncat (buff, bufftemp, strlen(bufftemp));\
         memset(bufftemp, 0, sizeof(bufftemp)); }\
        if ( *(ExceptionPtr+6) ) {\
         (void)sprintf(bufftemp,"P6: %08x ", (**(ExceptionPtr+6)) );\
         strncat (buff, bufftemp, strlen(bufftemp)); }\
        __LogException(buff,whereFile,whereLine);\
    }
    #endif
      

  2.   

    没有人能看明白?
    我在google和baidu上搜索竟然也找不到中文方面的资料
      

  3.   

    我知道功能是这个,我现在是要仿照这个代码,重新写一个,现在的格式出来的好像是一个地址,我现在想把错误的内容写出来。
    我不明白那些ExceptionPtr+5,ExceptionPtr+6是啥意思