网路编程 vc++网络编程实例向导 内容丰富 包含全面 对网络编程很有帮助

源代码在线查看: message.cpp

软件大小: 2521 K
上传用户: yubo0808140725
关键词: vc 网路 编程 网络
下载地址: 免注册下载 普通下载 VIP

相关代码

				// Message.cpp: implementation of the CMessage class.
				//
				//////////////////////////////////////////////////////////////////////
				
				#include "stdafx.h"
				#include "ChatSrvr.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 = 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 						ar 						ar 						ar 						ar 						ar 						ar 						ar 					}
					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;
					}
				}
				
				void CMessage::Reset()
				{
					image = 6;
					type = 0;
					secret = FALSE;
					color = RGB(0,136,255);
					m_bClose = FALSE;
					from = to = m_strText = _T("");
				}
							

相关资源