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

📄 ~message.~cpp

📁 网上聊天系统
💻 ~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;
	type = "微笑";
	secret = FALSE;
	color = RGB(0,136,255);
	bGuoLv = FALSE;
	from = to = m_strText = _T("");
}

CMessage::~CMessage()
{

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

CString CMessage::CMessageToNetPac()
{

   //接收者 发送者姓名 方式 是否私聊 是否过滤 发送内容 颜色
  	CString Netpac="5@";  //发送消息
	Netpac+=to;         //接收者
	Netpac+="@";
	Netpac+=from;       //发送者姓名 
	Netpac+="@";
	Netpac+=type;  //方式
	Netpac+="@";
	Netpac+=InttoStr(secret);  //是否私聊
	Netpac+="@";
	Netpac+=InttoStr(bGuoLv);  //是否过滤
	Netpac+="@";
	Netpac+=m_strText;     //发送内容
	Netpac+="@";
	Netpac+=InttoStr(color);//颜色
	return Netpac;
}

CString CMessage::InttoStr(int iNum)
{
	CString str;
    str.Format("%d",iNum);	
    return str;
}

⌨️ 快捷键说明

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