📄 mixoexception.cpp
字号:
//$Id: MiXoException.cpp,v 1.1 2001-05-08 17:08:21+02 mimo Exp mimo $
// MidiException.cpp: implementation of the CMidiException class.
//
//////////////////////////////////////////////////////////////////////
#include <sstream>
#include "MiXoException.h"
#include "stdafx.h"
CMiXoException::CMiXoException(unsigned u,const char *f,const char *l) throw()
:exception(),scMessage(),id(u)
{
stringstream stmTemp;
stmTemp << GetLocalError(u);
stmTemp << " in File:" << f << ", Line:" << l << ends;
scMessage=stmTemp.str();
};
string CMiXoException::GetSystemError() const
{
void far *lpMsgBuf; //(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM)
::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,::GetLastError(),MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),
(LPSTR)&lpMsgBuf,0,NULL);
string strTheMsg;
strTheMsg=reinterpret_cast<char far*>(lpMsgBuf);
LocalFree( lpMsgBuf );
return strTheMsg;
}
string CMiXoException::GetLocalError(unsigned u) const
{
stringstream stmTemp;
stmTemp << "MiXo-Error Code: " << u << " " << GetSystemError() << " TODO Load Error Codes from Resource" << endl;
string str=stmTemp.str();
return str;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -