资源简介
1、支持一对一的聊通信天;
2、支持聊天室的多对多聊天通信;
3、包括服务器与客户端整套源码。
代码片段和文件信息
// CChatServer.cpp : Defines the class behaviors for the application.
//
#include “stdafx.h“
#include “CChatServer.h“
#include “SetServerPortDlg.h“
#include “MyTreeView.h“
#include “ClientSocket.h“
#include “CIniFile.h“
#include “MainFrm.h“
#include “CChatServerDoc.h“
#include “CChatServerView.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCChatServerApp
BEGIN_MESSAGE_MAP(CCChatServerApp CWinApp)
//{{AFX_MSG_MAP(CCChatServerApp)
ON_COMMAND(ID_APP_ABOUT OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCChatServerApp construction
CCChatServerApp::CCChatServerApp():bInit(FALSE)
{
// TODO: add construction code here
// Place all significant initialization in InitInstance
m_pClientSocketList = new CPtrList();
CIniFile m_IniFile;
bInit = m_IniFile.Create(“RoomList.ini“);
if(bInit)
{
int iRoomNum;
m_IniFile.GetVarInt(“ROOMNUM““RoomNumber“iRoomNum);
for(int i = 1; i<=iRoomNum; i++)
{
CString *strRoom = new CString ;
CString strTemp ;;
strTemp.Format(“Room%d“i);
m_IniFile.GetVarStr(“ROOMNAME“strTemp*strRoom);
m_ChatRoomList.AddTail(strRoom);
}
}
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CCChatServerApp object
CCChatServerApp theApp;
CCriticalSection g_cs;
/////////////////////////////////////////////////////////////////////////////
// CCChatServerApp initialization
BOOL CCChatServerApp::InitInstance()
{
if(!bInit)
{
AfxMessageBox(“初始化文件不存在“);
return FALSE;
}
if (!AfxSocketInit())
{
return FALSE;
}
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T(“Local AppWizard-Generated Applications“));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 104268 2003-03-07 17:12 C++仿QQ界面\Code\QQClient.rar
文件 31404 2003-03-07 13:27 C++仿QQ界面\Code\QQServer\CChatServer.aps
文件 3564 2003-03-07 13:34 C++仿QQ界面\Code\QQServer\CChatServer.clw
文件 7382 2003-03-07 13:40 C++仿QQ界面\Code\QQServer\CChatServer.cpp
文件 6206 2003-03-07 13:11 C++仿QQ界面\Code\QQServer\CChatServer.dsp
文件 545 2003-02-26 17:02 C++仿QQ界面\Code\QQServer\CChatServer.dsw
文件 1646 2003-03-07 13:21 C++仿QQ界面\Code\QQServer\CChatServer.h
文件 99328 2003-03-07 17:00 C++仿QQ界面\Code\QQServer\CChatServer.ncb
文件 55808 2003-03-07 17:00 C++仿QQ界面\Code\QQServer\CChatServer.opt
文件 1657 2003-03-07 16:57 C++仿QQ界面\Code\QQServer\CChatServer.plg
文件 13594 2003-03-07 13:11 C++仿QQ界面\Code\QQServer\CChatServer.rc
文件 1842 2003-02-26 17:02 C++仿QQ界面\Code\QQServer\CChatServerDoc.cpp
文件 1530 2003-02-26 17:02 C++仿QQ界面\Code\QQServer\CChatServerDoc.h
文件 2729 2003-02-26 17:02 C++仿QQ界面\Code\QQServer\CChatServerView.cpp
文件 1971 2003-02-26 17:02 C++仿QQ界面\Code\QQServer\CChatServerView.h
文件 6000 2003-02-25 13:14 C++仿QQ界面\Code\QQServer\CIniFile.cpp
文件 1778 2003-01-06 19:13 C++仿QQ界面\Code\QQServer\CIniFile.h
文件 4319 2003-03-07 16:55 C++仿QQ界面\Code\QQServer\ClientSocket.cpp
文件 1662 2003-03-03 16:00 C++仿QQ界面\Code\QQServer\ClientSocket.h
文件 444 2003-02-28 10:55 C++仿QQ界面\Code\QQServer\CParseMessage.cpp
文件 397 2003-02-28 10:55 C++仿QQ界面\Code\QQServer\CParseMessage.h
文件 3629 2003-03-07 16:53 C++仿QQ界面\Code\QQServer\MainFrm.cpp
文件 1800 2003-03-07 16:54 C++仿QQ界面\Code\QQServer\MainFrm.h
文件 200 2003-03-03 10:32 C++仿QQ界面\Code\QQServer\Message.h
文件 1389 2003-02-26 17:24 C++仿QQ界面\Code\QQServer\MyFormView.cpp
文件 1632 2003-02-26 17:24 C++仿QQ界面\Code\QQServer\MyFormView.h
文件 7057 2003-03-07 16:57 C++仿QQ界面\Code\QQServer\MyTreeView.cpp
文件 1838 2003-03-07 16:50 C++仿QQ界面\Code\QQServer\MyTreeView.h
文件 1763 2003-03-07 16:57 C++仿QQ界面\Code\QQServer\ParseMessage.cpp
文件 436 2003-03-07 16:54 C++仿QQ界面\Code\QQServer\ParseMessage.h
............此处省略32个文件信息
- 上一篇:保险基础数据模型200801版.pdf
- 下一篇:哈工大数理逻辑课后答案
评论
共有 条评论