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

📄 message.cpp

📁 一个基于vc++的c/s架构的网络教学答疑系统。我的软件工程上机报告。
💻 CPP
字号:
// Message.cpp: implementation of the CMessage class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ChatClient.h"
#include "Message.h"

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

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

CMessage::CMessage()
{
	image = 6;
	major = 0;
	type1 = 0;
	type = 0;
	secret = FALSE;
	color = RGB(0,136,255);
	m_bClose = FALSE;
	from = to = m_strText = _T("");
}

CMessage::~CMessage()
{

}

void CMessage::Serialize(CArchive &ar)
{
	if (ar.IsStoring()){
		ar << type;
		ar << (WORD)m_bClose;
		ar << m_strText;
		ar << (WORD)secret;
		ar << from;
		ar << to;
		ar << (DWORD)color;
		ar << image;
		ar << major;
		ar << type1;
	}
	else{
		WORD wd;
		DWORD dwTmp;

		ar >> type;
		ar >> wd;
		m_bClose = (BOOL)wd;
		ar >> m_strText;
		ar >> wd;
		secret = (BOOL)wd;
		ar >> from;
		ar >> to;
		ar >> dwTmp;
		color = (COLORREF)dwTmp;
		ar >> image;
		ar >> major;
		ar >> type1;
	}
/*	
	m_msgList.Serialize(ar);
	fromlist.Serialize(ar);
	tolist.Serialize(ar);
	seclist.Serialize(ar);
	typelist.Serialize(ar);
	clrlist.Serialize(ar); 
*/}

void CMessage::Reset()
{
	image = 6;
	type = 0;
	secret = FALSE;
	color = RGB(0,136,255);
	m_bClose = FALSE;
	from = to = m_strText = _T("");
	major = 0;
	type1 = 0;
}

⌨️ 快捷键说明

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