abwinexception.cpp

来自「miXo is a buzz machine (www.buzzmachines」· C++ 代码 · 共 51 行

CPP
51
字号
// AbWinException.cpp: implementation of the CAbWinException class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "mixer.h"
#include "AbWinException.h"
#include <sstream>

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CAbWinException::CAbWinException(unsigned u,const char *f,unsigned l,
								 const WNDCLASSEX&wndclass,bool bSystem) 
:m_strDetails(GetDetailedMessage(wndclass)),CAbException(u,f,l,bSystem)
{
#ifdef _DEBUG
	::OutputDebugString(m_strDetails.c_str());
#endif
}

CAbWinException::~CAbWinException()
{
}
string CAbWinException::GetMessage() const
{
	string strMsg=CAbException::GetMessage();
	strMsg+="\n";
	strMsg+=m_strDetails;
	return strMsg;
}
string CAbWinException::GetDetailedMessage(const WNDCLASSEX &w)
{
	stringstream stm;
	stm <<"WindowClass: cbSize="<<w.cbSize<<" style="<<w.style;
	stm	<<" WndProc="<<(void*)w.lpfnWndProc;
	stm	<<" ClsExtra="<<w.cbClsExtra<<" WndExtra="<<w.cbWndExtra;
	stm	<<" hInstance="<<(void*)w.hInstance;
	stm	<<" hIcon="<<(void*)w.hIcon<<" hCursor="<<(void*)w.hCursor<<" hbrBg="<<(void*)w.hbrBackground;
	stm	<<" MenuName="<<(void*)w.lpszMenuName;
	stm <<" ClassName="<<w.lpszClassName<<" hIconSm="<<(void*)w.hIconSm<<ends;
	return stm.str();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?