www.pudn.com > XmudOSr.rar > MesssageWnd.cpp


// MesssageWnd.cpp: implementation of the CMesssageWnd class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#include "stdafx.h" 
#include "XMudClient.h" 
#include "MesssageWnd.h" 
#include "FacePlate.h" 
 
#ifdef _DEBUG 
#undef THIS_FILE 
static char THIS_FILE[]=__FILE__; 
#define new DEBUG_NEW 
#endif 
 
////////////////////////////////////////////////////////////////////// 
// Construction/Destruction 
////////////////////////////////////////////////////////////////////// 
 
CMesssageWnd::CMesssageWnd() 
{ 
 
} 
 
CMesssageWnd::~CMesssageWnd() 
{ 
 
} 
 
void CMesssageWnd::AddMsg(char* Msg) 
{ 
	try				//加入一条信息 
	{ 
		if(m_MsgList.GetCount()>nSumOfMsg) 
		{ 
			m_MsgList.AddTail(m_MsgList.RemoveHead() = Msg); 
		} 
		else 
		{ 
			m_MsgList.AddTail(Msg); 
		} 
	} 
	catch(CMemoryException ex) 
	{ 
		ex.ReportError(MB_OK|MB_ICONEXCLAMATION,IDS_MEMRROR); 
	} 
}