#define RECORD_MESS(lp_rec_mess,ret) \
{ \
try \
{ \
memset(lp_rec_mess,0,sizeof(lp_rec_mess)); \
LPVOID lpMsgBuf; \
FormatMessage( \
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,\
NULL, \
GetLastError(), \
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), \
(LPTSTR) &lpMsgBuf, \
0, NULL ); \
sprintf(lp_rec_mess,"Time:[%s] File name:[%s] line:[%d],cause:[%s]",__TIMESTAMP__,__FILE__,__LINE__,lpMsgBuf); \
LocalFree(lpMsgBuf); \
ret = 0; \
} \
catch(...) \
{ \
ret = -1; \
} \
}
posted on 2006-03-24 17:15 自由空间 阅读(3793)
评论(7) 编辑 收藏