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

📄 msg.cpp

📁 利用CSocket类编写的一个网络聊天程序,加深对CSocket类的基本应用的认识.
💻 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
//////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNCREATE(CMsg, CObject)
CMsg::CMsg()
{
	Init();
}

CMsg::~CMsg()
{

}

void CMsg::Init()
{
	code = 0;
	m_bClose = FALSE;
	m_strText = _T("");
}

void CMsg::Serialize(CArchive& ar)
{
	//读入
	if (ar.IsStoring())
	{
		ar << (WORD)m_bClose;
		ar << m_strText;
		ar << code;
	}
	//输出
	else
	{
		WORD wd;
		ar >> wd;
		m_bClose = (BOOL)wd;
		ar >> m_strText;
		ar >> (UINT)code;
	}
}

⌨️ 快捷键说明

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