資源簡介
本代碼使用C++實現的網絡編程基礎技術,能夠互相發一些簡單的聊天內容,希望初學者們能夠喜歡!!!
代碼片段和文件信息
//?ChatClient.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“ChatClient.h“
#include?“ChatClientDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CChatClientApp
BEGIN_MESSAGE_MAP(CChatClientApp?CWinApp)
//{{AFX_MSG_MAP(CChatClientApp)
//?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()
/////////////////////////////////////////////////////////////////////////////
//?CChatClientApp?construction
CChatClientApp::CChatClientApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CChatClientApp?object
CChatClientApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CChatClientApp?initialization
BOOL?CChatClientApp::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
CChatClientDlg?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;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-10-01?11:32??ChatClient\
?????文件???????21328??2012-07-04?15:07??ChatClient\ChatClient.aps
?????文件????????1575??2012-07-06?08:05??ChatClient\ChatClient.clw
?????文件????????2213??2012-07-03?12:11??ChatClient\ChatClient.cpp
?????文件????????4367??2012-07-03?12:14??ChatClient\ChatClient.dsp
?????文件?????????528??2012-07-03?12:11??ChatClient\ChatClient.dsw
?????文件????????1368??2012-07-03?12:11??ChatClient\ChatClient.h
?????文件????10406912??2012-10-01?11:33??ChatClient\ChatClient.ncb
?????文件???????54784??2012-07-06?08:08??ChatClient\ChatClient.opt
?????文件????????1472??2012-07-03?19:23??ChatClient\ChatClient.plg
?????文件????????5753??2012-07-03?15:43??ChatClient\ChatClient.rc
?????文件?????????884??2012-10-01?11:32??ChatClient\ChatClient.sln
?????文件????????7168??2012-10-01?11:33??ChatClient\ChatClient.suo
?????文件????????7769??2012-10-01?11:32??ChatClient\ChatClient.vcproj
?????文件????????1413??2012-10-01?11:33??ChatClient\ChatClient.vcproj.Osier-PC.Osier.user
?????文件????????5165??2012-07-03?19:19??ChatClient\ChatClientDlg.cpp
?????文件????????1557??2012-07-03?19:23??ChatClient\ChatClientDlg.h
?????文件????????1239??2012-07-03?15:58??ChatClient\ClientSocket.cpp
?????文件????????1197??2012-07-03?15:50??ChatClient\ClientSocket.h
?????目錄???????????0??2012-10-01?11:32??ChatClient\Debug\
?????文件???????10462??2012-10-01?11:32??ChatClient\Debug\BuildLog.htm
?????文件???????90112??2012-10-01?11:32??ChatClient\Debug\ChatClient.exe
?????文件?????????664??2012-10-01?11:32??ChatClient\Debug\ChatClient.exe.em
?????文件?????????728??2012-10-01?11:32??ChatClient\Debug\ChatClient.exe.em
?????文件?????????629??2012-10-01?11:32??ChatClient\Debug\ChatClient.exe.intermediate.manifest
?????文件??????226200??2012-10-01?11:32??ChatClient\Debug\ChatClient.ilk
?????文件???????22025??2012-10-01?11:32??ChatClient\Debug\ChatClient.obj
?????文件????13959168??2012-10-01?11:32??ChatClient\Debug\ChatClient.pch
?????文件?????3263488??2012-10-01?11:32??ChatClient\Debug\ChatClient.pdb
?????文件????????2820??2012-07-03?19:18??ChatClient\Debug\ChatClient.res
?????文件???????50543??2012-10-01?11:32??ChatClient\Debug\ChatClientDlg.obj
............此處省略62個文件信息
- 上一篇:瀏覽器截屏程序源代碼C++
- 下一篇:基于RFID的MFC考勤管理系統
評論
共有 條評論