資源簡(jiǎn)介
一個(gè)使用MFC實(shí)現(xiàn)的tcp客戶端程序,程序簡(jiǎn)單,想學(xué)習(xí)mfc的或是tcp套接字的可以參考下。

代碼片段和文件信息
//?MFCTCP客戶端.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“MFCTCP客戶端.h“
#include?“MFCTCP客戶端Dlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CMFCTCPApp
BEGIN_MESSAGE_MAP(CMFCTCPApp?CWinApp)
//{{AFX_MSG_MAP(CMFCTCPApp)
//?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()
/////////////////////////////////////////////////////////////////////////////
//?CMFCTCPApp?construction
CMFCTCPApp::CMFCTCPApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CMFCTCPApp?object
CMFCTCPApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CMFCTCPApp?initialization
BOOL?CMFCTCPApp::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
CMFCTCPDlg?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;
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-03-31?19:55??MFCTCP客戶端\
?????目錄???????????0??2014-03-31?19:54??MFCTCP客戶端\Debug\
?????文件?????2170956??2014-03-26?20:44??MFCTCP客戶端\Debug\MFCTCP客戶端.exe
?????文件?????2578308??2014-03-26?20:44??MFCTCP客戶端\Debug\MFCTCP客戶端.ilk
?????文件???????13408??2014-03-26?20:38??MFCTCP客戶端\Debug\MFCTCP客戶端.obj
?????文件?????5602452??2014-03-25?19:36??MFCTCP客戶端\Debug\MFCTCP客戶端.pch
?????文件?????4195328??2014-03-26?20:44??MFCTCP客戶端\Debug\MFCTCP客戶端.pdb
?????文件????????8860??2014-03-26?19:28??MFCTCP客戶端\Debug\MFCTCP客戶端.res
?????文件???????32534??2014-03-26?20:44??MFCTCP客戶端\Debug\MFCTCP客戶端Dlg.obj
?????文件??????106504??2014-03-25?19:36??MFCTCP客戶端\Debug\StdAfx.obj
?????文件??????214016??2014-03-26?20:44??MFCTCP客戶端\Debug\vc60.idb
?????文件??????364544??2014-03-26?20:44??MFCTCP客戶端\Debug\vc60.pdb
?????文件???????21368??2014-03-31?19:54??MFCTCP客戶端\MFCTCP客戶端.APS
?????文件????????1388??2014-03-31?19:55??MFCTCP客戶端\MFCTCP客戶端.clw
?????文件????????2175??2014-03-25?09:27??MFCTCP客戶端\MFCTCP客戶端.cpp
?????文件????????4280??2014-03-26?14:51??MFCTCP客戶端\MFCTCP客戶端.dsp
?????文件?????????532??2014-03-25?09:27??MFCTCP客戶端\MFCTCP客戶端.dsw
?????文件????????1342??2014-03-25?09:27??MFCTCP客戶端\MFCTCP客戶端.h
?????文件???????66560??2014-03-31?19:55??MFCTCP客戶端\MFCTCP客戶端.ncb
?????文件???????50688??2014-03-31?19:55??MFCTCP客戶端\MFCTCP客戶端.opt
?????文件?????????994??2014-03-26?20:44??MFCTCP客戶端\MFCTCP客戶端.plg
?????文件????????5819??2014-03-26?19:28??MFCTCP客戶端\MFCTCP客戶端.rc
?????文件?????????204??2014-03-31?19:55??MFCTCP客戶端\MFCTCP客戶端.sln
?????文件????????7680??2014-03-31?19:55??MFCTCP客戶端\MFCTCP客戶端.suo
?????文件????????7483??2014-03-31?19:55??MFCTCP客戶端\MFCTCP客戶端Dlg.cpp
?????文件????????1490??2014-03-26?20:38??MFCTCP客戶端\MFCTCP客戶端Dlg.h
?????文件????????3669??2014-03-25?09:27??MFCTCP客戶端\ReadMe.txt
?????文件?????????214??2014-03-25?09:27??MFCTCP客戶端\StdAfx.cpp
?????文件????????1102??2014-03-25?09:27??MFCTCP客戶端\StdAfx.h
?????目錄???????????0??2014-03-31?19:54??MFCTCP客戶端\res\
?????文件????????1078??2014-03-25?09:27??MFCTCP客戶端\res\MFCTCP客戶端.ico
............此處省略2個(gè)文件信息
評(píng)論
共有 條評(píng)論