⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msg.cpp

📁 基于winsock的聊天程序
💻 CPP
字号:
// Msg.cpp: implementation of the CMsg class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ChatClient.h"
#include "Msg.h"

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

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

CMsg::CMsg()
{
	m_dImage = 6;
	m_nType =-1;
	m_bSecret = FALSE;
	m_color = RGB(0,136,255);
	m_bClose = FALSE;
	m_strFrom = m_strTo = m_strText = _T("");
}

CMsg::~CMsg()
{

}

void CMsg::Serialize(CArchive &ar)
{
	if (ar.IsStoring()){
		ar << m_nType;
		ar << (WORD)m_bClose;
		ar << m_strText;
		ar << (WORD)m_bSecret;
		ar << m_strFrom;
		ar << m_strTo;
		ar << (DWORD)m_color;
		ar << m_dImage;
	}
	else{
		WORD wd;
		DWORD dwTmp;

		ar >> m_nType;
		ar >> wd;
		m_bClose = (BOOL)wd;
		ar >> m_strText;
		ar >> wd;
		m_bSecret = (BOOL)wd;
		ar >> m_strFrom;
		ar >> m_strTo;
		ar >> dwTmp;
		m_color = (COLORREF)dwTmp;
		ar >> m_dImage;
	}
}

void CMsg::Reset()
{
	m_dImage = 6;
	m_nType =-1;
	m_bSecret = FALSE;
	m_color = RGB(0,136,255);
	m_bClose = FALSE;
	m_strFrom = m_strTo = m_strText = _T("");

}

⌨️ 快捷键说明

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