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

📄 msg.cpp

📁 Visual_C++.NET精彩案例237.rar
💻 CPP
字号:

#include "stdafx.h"
#include "msg.h"

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif


// CMsg

IMPLEMENT_DYNCREATE(CMsg, CObject)


// CMsg 构造和析构函数

CMsg::CMsg()
{
	Init();
}

CMsg::~CMsg()
{
}


// CMsg 操作

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



void CMsg::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{//接收数据
		ar << (WORD)m_bClose;
		ar << m_strText;
		ar << n_Bytes;
		ar << (WORD)m_bFileClose;
	}
	else
	{//发送数据 
		WORD wd;
		ar >> wd;
		m_bClose = (BOOL)wd;
		ar >> m_strText;
		ar >> n_Bytes;
		ar >> wd;
		m_bFileClose=(WORD)wd;
	}
}


// CMsg 诊断

#ifdef _DEBUG
void CMsg::AssertValid() const
{
	CObject::AssertValid();
}

void CMsg::Dump(CDumpContext& dc) const
{
	CObject::Dump(dc);
}
#endif //_DEBUG

⌨️ 快捷键说明

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