• 大小: 4.28MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-28
  • 语言: C/C++
  • 标签: tcp  mfc  

资源简介

一个使用MFC实现的tcp客户端程序,程序简单,想学习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;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           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个文件信息

评论

共有 条评论