資源簡(jiǎn)介
tcp通訊的基礎(chǔ) vs2010完成 MFC界面 socket編程入門(mén)級(jí)別的小軟件

代碼片段和文件信息
//?ChatroomClient.cpp?:?定義應(yīng)用程序的類行為。
//
#include?“stdafx.h“
#include?“afxwinappex.h“
#include?“afxdialogex.h“
#include?“ChatroomClient.h“
#include?“MainFrm.h“
#include?“ChatroomClientDoc.h“
#include?“ChatroomClientView.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#endif
//?CChatroomClientApp
BEGIN_MESSAGE_MAP(CChatroomClientApp?CWinApp)
ON_COMMAND(ID_APP_ABOUT?&CChatroomClientApp::OnAppAbout)
//?基于文件的標(biāo)準(zhǔn)文檔命令
ON_COMMAND(ID_FILE_NEW?&CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN?&CWinApp::OnFileOpen)
END_MESSAGE_MAP()
//?CChatroomClientApp?構(gòu)造
CChatroomClientApp::CChatroomClientApp()
{
//?支持重新啟動(dòng)管理器
m_dwRestartManagerSupportFlags?=?AFX_RESTART_MANAGER_SUPPORT_ALL_ASPECTS;
#ifdef?_MANAGED
//?如果應(yīng)用程序是利用公共語(yǔ)言運(yùn)行時(shí)支持(/clr)構(gòu)建的,則:
//?????1)?必須有此附加設(shè)置,“重新啟動(dòng)管理器”支持才能正常工作。
//?????2)?在您的項(xiàng)目中,您必須按照生成順序向?System.Windows.Forms?添加引用。
System::Windows::Forms::Application::SetUnhandledExceptionMode(System::Windows::Forms::UnhandledExceptionMode::ThrowException);
#endif
//?TODO:?將以下應(yīng)用程序?ID?字符串替換為唯一的?ID?字符串;建議的字符串格式
//為?CompanyName.ProductName.SubProduct.VersionInformation
SetAppID(_T(“ChatroomClient.AppID.NoVersion“));
//?TODO:?在此處添加構(gòu)造代碼,
//?將所有重要的初始化放置在?InitInstance?中
}
//?唯一的一個(gè)?CChatroomClientApp?對(duì)象
CChatroomClientApp?theApp;
//?CChatroomClientApp?初始化
BOOL?CChatroomClientApp::InitInstance()
{
//?如果一個(gè)運(yùn)行在?Windows?XP?上的應(yīng)用程序清單指定要
//?使用?ComCtl32.dll?版本?6?或更高版本來(lái)啟用可視化方式,
//則需要?InitCommonControlsEx()。否則,將無(wú)法創(chuàng)建窗口。
INITCOMMONCONTROLSEX?InitCtrls;
InitCtrls.dwSize?=?sizeof(InitCtrls);
//?將它設(shè)置為包括所有要在應(yīng)用程序中使用的
//?公共控件類。
InitCtrls.dwICC?=?ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
//?初始化?OLE?庫(kù)
if?(!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return?FALSE;
}
AfxEnableControlContainer();
EnableTaskbarInteraction(FALSE);
//?使用?RichEdit?控件需要??AfxInitRichEdit2()
//?AfxInitRichEdit2();
//?標(biāo)準(zhǔn)初始化
//?如果未使用這些功能并希望減小
//?最終可執(zhí)行文件的大小,則應(yīng)移除下列
//?不需要的特定初始化例程
//?更改用于存儲(chǔ)設(shè)置的注冊(cè)表項(xiàng)
//?TODO:?應(yīng)適當(dāng)修改該字符串,
//?例如修改為公司或組織名
SetRegistryKey(_T(“應(yīng)用程序向?qū)傻谋镜貞?yīng)用程序“));
LoadStdProfileSettings(4);??//?加載標(biāo)準(zhǔn)?INI?文件選項(xiàng)(包括?MRU)
//?注冊(cè)應(yīng)用程序的文檔模板。文檔模板
//?將用作文檔、框架窗口和視圖之間的連接
CSingleDocTemplate*?pDocTemplate;
pDocTemplate?=?new?CSingleDocTemplate(
IDR_MAINframe
RUNTIME_CLASS(CChatroomClientDoc)
RUNTIME_CLASS(CMainframe)???????//?主?SDI?框架窗口
RUNTIME_CLASS(CChatroomClientView));
if?(!pDocTemplate)
return?FALSE;
AddDocTemplate(pDocTemplate);
//?分析標(biāo)準(zhǔn)?shell?命令、DDE、打開(kāi)文件操作的命令行
CCommandLineInfo?cmdInfo;
ParseCommandLine(cmdInfo);
//?調(diào)度在命令行中指定的命令。如果
//?用?/RegServer、/Register、/Unregserver?或?/Unregister?啟動(dòng)應(yīng)用程序,則返回?FALSE。
if?(!ProcessShellCommand(cmdInfo))
return?FALSE;
//?唯一的一個(gè)窗口已初始化,因此顯示它并對(duì)其進(jìn)行更新
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
//?僅當(dāng)具有后綴時(shí)才調(diào)用?DragAcceptFiles
//??在?SDI?應(yīng)用程序中,這應(yīng)在?ProcessShellCommand?之后發(fā)生
return?TRUE;
}
int?CChatroomClientApp::ExitInstance
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????1390??2011-10-04?21:05??Chatroom.sln
?????文件?????116392??2011-10-06?13:42??ChatroomClient\ChatroomClient.aps
?????文件???????4318??2011-10-05?12:53??ChatroomClient\ChatroomClient.cpp
?????文件????????556??2011-10-04?20:59??ChatroomClient\ChatroomClient.h
?????文件??????18586??2011-10-06?13:42??ChatroomClient\ChatroomClient.rc
?????文件???????6282??2011-10-06?11:21??ChatroomClient\ChatroomClient.vcxproj
?????文件???????2517??2011-10-04?20:59??ChatroomClient\ChatroomClient.vcxproj.filters
?????文件????????143??2011-10-04?20:59??ChatroomClient\ChatroomClient.vcxproj.user
?????文件???????2684??2011-10-04?20:59??ChatroomClient\ChatroomClientDoc.cpp
?????文件????????895??2011-10-04?20:59??ChatroomClient\ChatroomClientDoc.h
?????文件???????4113??2011-10-05?14:20??ChatroomClient\ChatroomClientView.cpp
?????文件???????1385??2011-10-05?14:11??ChatroomClient\ChatroomClientView.h
?????文件????????863??2011-10-04?20:59??ChatroomClient\MainFrm.cpp
?????文件????????513??2011-10-04?20:59??ChatroomClient\MainFrm.h
?????文件???????3522??2011-10-04?20:59??ChatroomClient\ReadMe.txt
????.......?????67777??2009-08-31?02:31??ChatroomClient\res\ChatroomClient.ico
?????文件????????684??2011-10-04?20:59??ChatroomClient\res\ChatroomClient.rc2
????.......??????4710??2009-08-31?02:31??ChatroomClient\res\ChatroomClientDoc.ico
?????文件???????1828??2011-10-05?23:45??ChatroomClient\resource.h
?????文件????????147??2011-10-04?20:59??ChatroomClient\stdafx.cpp
?????文件???????1691??2011-10-05?11:26??ChatroomClient\stdafx.h
?????文件????????234??2011-10-04?20:59??ChatroomClient\targetver.h
?????文件?????116032??2011-10-05?22:29??ChatroomServer\ChatroomServer.aps
?????文件???????4320??2011-10-04?20:58??ChatroomServer\ChatroomServer.cpp
?????文件????????556??2011-10-04?20:58??ChatroomServer\ChatroomServer.h
?????文件??????18094??2011-10-05?22:29??ChatroomServer\ChatroomServer.rc
?????文件???????6299??2011-10-06?11:21??ChatroomServer\ChatroomServer.vcxproj
?????文件???????2517??2011-10-04?20:58??ChatroomServer\ChatroomServer.vcxproj.filters
?????文件????????143??2011-10-04?20:58??ChatroomServer\ChatroomServer.vcxproj.user
?????文件???????2738??2011-10-05?14:22??ChatroomServer\ChatroomServerDoc.cpp
............此處省略22個(gè)文件信息
評(píng)論
共有 條評(píng)論