基于UDP的MFC 通讯小程序


基于UDP的MFC通讯程序,数据发送 接受 广播 端口设置 ip设置
资源截图
代码片段和文件信息
// msocudp.cpp : Defines the class behaviors for the application.
//

#include “stdafx.h“
#include “UDpAsySk.h“
#include “msocudp.h“
#include “msocudpDlg.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMsocudpApp

BEGIN_MESSAGE_MAP(CMsocudpApp CWinApp)
//{{AFX_MSG_MAP(CMsocudpApp)
// 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()

/////////////////////////////////////////////////////////////////////////////
// CMsocudpApp construction

CMsocudpApp::CMsocudpApp()
{
// TODO: add construction code here
// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CMsocudpApp object

CMsocudpApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CMsocudpApp initialization

BOOL CMsocudpApp::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

CMsocudpDlg 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-07-26 20:57  56257935MFCUDP
     目录           0  2012-08-04 11:17  56257935MFCUDPMFCUDP
     目录           0  2012-07-26 20:58  56257935MFCUDPMFCUDPDebug
     文件        6474  2012-07-18 09:33  56257935MFCUDPMFCUDPDebugcl.command.1.tlog
     文件       64064  2012-07-18 09:33  56257935MFCUDPMFCUDPDebugCL.read.1.tlog
     文件        4302  2012-07-18 09:33  56257935MFCUDPMFCUDPDebugCL.write.1.tlog
     文件           2  2012-07-18 09:36  56257935MFCUDPMFCUDPDebuglink-cvtres.read.1.tlog
     文件           2  2012-07-18 09:36  56257935MFCUDPMFCUDPDebuglink-cvtres.write.1.tlog
     文件        3784  2012-07-18 09:36  56257935MFCUDPMFCUDPDebuglink.command.1.tlog
     文件       10486  2012-07-18 09:36  56257935MFCUDPMFCUDPDebuglink.read.1.tlog
     文件        2942  2012-07-18 09:36  56257935MFCUDPMFCUDPDebuglink.write.1.tlog
     文件       71168  2012-07-18 09:36  56257935MFCUDPMFCUDPDebugmsocudp.exe
     文件         667  2012-07-15 21:18  56257935MFCUDPMFCUDPDebugmsocudp.exe.embed.manifest
     文件         732  2012-07-17 08:54  56257935MFCUDPMFCUDPDebugmsocudp.exe.embed.manifest.res
     文件         381  2012-07-18 09:36  56257935MFCUDPMFCUDPDebugmsocudp.exe.intermediate.manifest
     文件     1060376  2012-07-18 09:36  56257935MFCUDPMFCUDPDebugmsocudp.ilk
     文件          96  2012-07-18 09:36  56257935MFCUDPMFCUDPDebugmsocudp.lastbuildstate
     文件        1294  2012-07-18 09:36  56257935MFCUDPMFCUDPDebugmsocudp.log
     文件       25089  2012-07-17 15:46  56257935MFCUDPMFCUDPDebugmsocudp.obj
     文件    20381696  2012-07-17 08:53  56257935MFCUDPMFCUDPDebugmsocudp.pch
     文件     3804160  2012-07-18 09:36  56257935MFCUDPMFCUDPDebugmsocudp.pdb
     文件        3804  2012-07-18 09:33  56257935MFCUDPMFCUDPDebugmsocudp.res
     文件       44852  2012-07-18 09:33  56257935MFCUDPMFCUDPDebugmsocudpDlg.obj
     文件         210  2012-07-15 21:18  56257935MFCUDPMFCUDPDebugmsocudp_manifest.rc
     文件        1500  2012-07-18 09:36  56257935MFCUDPMFCUDPDebugmt.command.1.tlog
     文件        1522  2012-07-18 09:36  56257935MFCUDPMFCUDPDebugmt.read.1.tlog
     文件         466  2012-07-18 09:36  56257935MFCUDPMFCUDPDebugmt.write.1.tlog
     文件        2414  2012-07-18 09:33  56257935MFCUDPMFCUDPDebug
c.command.1.tlog
     文件        6314  2012-07-18 09:33  56257935MFCUDPMFCUDPDebug
c.read.1.tlog
     文件        1202  2012-07-18 09:33  56257935MFCUDPMFCUDPDebug
c.write.1.tlog
     文件      556249  2012-07-17 08:54  56257935MFCUDPMFCUDPDebugStdAfx.obj
............此处省略57个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)