?? shpp.cpp
字號:
#include "SHPP.h"
#ifdef _DEBUG
char* CErrorMessage::ErrorString[] =
{
{"請求處理成功"}, //0 KN_OK
{"沒有注冊非法的IP地址"}, //-1 KN_RequestFailed
{"你沒有這個權限"}, //-2 KN_Unimplemented
{"密碼錯誤"}, //-3 KN_WrongVersion
{"非法請求"}, //-4 KN_ReqBufOverflow
{"參數出錯"}, //-5 KN_SocketError
{"不能打印這月份的清單"}, //-6 KN_FileNotFound
{"本月沒有清單"}, //-7 KN_ValueNotFound
{"你有欠費"}, //-8 KN_BadIndex
{"版本出錯"}, //-9
{"未定義"}, //-10 KN_SessionIDRepeat
{"網絡出錯"}, //-11
};
CErrorMessage::CErrorMessage(char* inMes /* = NULL*/,KN_Error snError /* = 0*/)
{
m_sfssError = snError * -1;
m_nSysError = WSAGetLastError();
if(inMes)
{
m_pchMes = new char[strlen(inMes)+1];
strcpy((char*)m_pchMes,inMes);
}
else m_pchMes = NULL;
}
CErrorMessage::~CErrorMessage()
{
if(m_pchMes)
delete []m_pchMes;
}
Bool16 CErrorMessage::GetErrorMessage(char* pchErrorMessage)
{
char text[200];
if(m_nSysError == 0) {
if(m_pchMes)
wsprintf(text, "%s : %s error", (const char*) ErrorString[m_sfssError],m_pchMes);
else
wsprintf(text, "%s error", (const char*) ErrorString[m_sfssError]);
}
else {
if(m_pchMes)
wsprintf(text, "%s : %s error #%d", (const char*) ErrorString[m_sfssError],m_pchMes, m_nSysError);
else
wsprintf(text, "%s error #%d", (const char*) ErrorString[m_sfssError], m_nSysError);
}
strncpy(pchErrorMessage, text,strlen(text));
*(pchErrorMessage+strlen(text)) = '\0';
return TRUE;
}
#endif //_DEBUG
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -