資源簡介
自己編的,用最簡單的SELECT模型和多線程技術實現的,還有許多不足之處,但是能實現基本的私聊,群聊,服務器廣播功能,我會在以后加以改進。

代碼片段和文件信息
//?chatroom.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“chatroom.h“
#include?“chatroomDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CChatroomApp
BEGIN_MESSAGE_MAP(CChatroomApp?CWinApp)
//{{AFX_MSG_MAP(CChatroomApp)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code!
//}}AFX_MSG
ON_COMMAND(ID_HELP?CWinApp::onhelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CChatroomApp?construction
CChatroomApp::CChatroomApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CChatroomApp?object
CChatroomApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CChatroomApp?initialization
BOOL?CChatroomApp::InitInstance()
{
if?(!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
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
CChatroomDlg?dlg;
m_pMainWnd?=?&dlg;
int?nResponse?=?dlg.DoModal();
if?(nResponse?==?IDOK)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?OK
}
else?if?(nResponse?==?IDCANCEL)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?Cancel
}
//?Since?the?dialog?has?been?closed?return?FALSE?so?that?we?exit?the
//??application?rather?than?start?the?application‘s?message?pump.
return?FALSE;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????37240??2009-06-13?15:54??聊天室\chatroom\chatroom.aps
?????文件???????1924??2009-06-20?15:02??聊天室\chatroom\chatroom.clw
?????文件???????2185??2009-06-01?15:25??聊天室\chatroom\chatroom.cpp
?????文件???????4199??2009-06-01?17:38??聊天室\chatroom\chatroom.dsp
?????文件????????539??2009-06-01?15:25??聊天室\chatroom\chatroom.dsw
?????文件???????1346??2009-06-01?15:25??聊天室\chatroom\chatroom.h
?????文件?????115712??2009-06-20?15:02??聊天室\chatroom\chatroom.ncb
?????文件??????55808??2009-06-20?15:02??聊天室\chatroom\chatroom.opt
?????文件???????1772??2009-06-20?15:01??聊天室\chatroom\chatroom.plg
?????文件???????6645??2009-06-13?15:54??聊天室\chatroom\chatroom.rc
?????文件??????14789??2009-06-18?20:19??聊天室\chatroom\chatroomDlg.cpp
?????文件???????2536??2009-06-18?20:19??聊天室\chatroom\chatroomDlg.h
?????文件????4981760??2009-06-11?17:59??聊天室\chatroom\Debug\chatroom.bsc
?????文件?????122934??2009-06-11?17:59??聊天室\chatroom\Debug\chatroom.exe
?????文件?????297176??2009-06-11?17:59??聊天室\chatroom\Debug\chatroom.ilk
?????文件??????29766??2009-06-11?16:54??聊天室\chatroom\Debug\chatroom.obj
?????文件????9095360??2009-06-11?16:54??聊天室\chatroom\Debug\chatroom.pch
?????文件?????459776??2009-06-11?17:59??聊天室\chatroom\Debug\chatroom.pdb
?????文件???????3372??2009-06-11?17:52??聊天室\chatroom\Debug\chatroom.res
?????文件??????????0??2009-06-11?16:55??聊天室\chatroom\Debug\chatroom.sbr
?????文件??????76221??2009-06-11?17:59??聊天室\chatroom\Debug\chatroomDlg.obj
?????文件??????????0??2009-06-11?17:59??聊天室\chatroom\Debug\chatroomDlg.sbr
?????文件?????156548??2009-06-11?16:54??聊天室\chatroom\Debug\StdAfx.obj
?????文件????1944063??2009-06-11?16:54??聊天室\chatroom\Debug\StdAfx.sbr
?????文件?????230400??2009-06-11?17:59??聊天室\chatroom\Debug\vc60.idb
?????文件?????528384??2009-06-11?17:59??聊天室\chatroom\Debug\vc60.pdb
?????文件???????3615??2009-06-01?15:25??聊天室\chatroom\ReadMe.txt
?????文件???????1078??2009-06-01?15:25??聊天室\chatroom\res\chatroom.ico
?????文件????????400??2009-06-01?15:25??聊天室\chatroom\res\chatroom.rc2
????..A.SH.??????3072??2009-06-20?15:00??聊天室\chatroom\res\Thumbs.db
............此處省略10個文件信息
- 上一篇:OpenSSL客戶端服務器源碼
- 下一篇:RFID讀寫器的程序
評論
共有 條評論