资源简介
能实现局域网内的点对点聊天,同时能实现局域网内文件传送。
代码片段和文件信息
// Chat.cpp : Defines the class behaviors for the application.
//
#include “stdafx.h“
#include “Chat.h“
#include “ChatDlg.h“
#include
#pragma comment(lib “Ws2_32.lib“)
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChatApp
BEGIN_MESSAGE_MAP(CChatApp CWinApp)
//{{AFX_MSG_MAP(CChatApp)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CChatApp construction
CChatApp::CChatApp()
{
// TODO: add construction code here
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CChatApp object
CChatApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CChatApp initialization
BOOL CChatApp::InitInstance()
{
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
//******加载同步套接字库
/*WORD wVersionRequested1;
WSADATA wsaData1;
int err1;
wVersionRequested1=MAKEWORD(11);
err1=WSAStartup(wVersionRequested1&wsaData1);
if(err1!=0)
{
return FALSE;
}
if(LOBYTE(wsaData1.wVersion)!=2||HIBYTE(wsaData1.wVersion)!=2)
{
WSACleanup();
return FALSE;
}*/
//**********
//*******加载异步套接字库
WORD wVersionRequested;
WSADATA wsaData;
int err;
wVersionRequested=MAKEWORD(22);
err=WSAStartup(wVersionRequested&wsaData);
if(err!=0)
{
return FALSE;
}
if(LOBYTE(wsaData.wVersion)!=2||HIBYTE(wsaData.wVersion)!=2)
{
WSACleanup();
return FALSE;
}
//******************
CChatDlg 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;
}
CChatApp::~CChatApp()
{
WSACleanup();
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2011-07-19 19:27 Chat\
文件 3582 2011-07-12 16:15 Chat\1.ICO
文件 1270 2011-07-18 20:12 Chat\bitmap1.bmp
文件 43972 2011-07-19 21:26 Chat\Chat.aps
文件 1402 2011-07-20 15:10 Chat\Chat.clw
文件 2850 2011-07-19 20:49 Chat\Chat.cpp
文件 4369 2011-07-19 15:54 Chat\Chat.dsp
文件 514 2011-07-18 21:08 Chat\Chat.dsw
文件 1325 2011-07-19 20:49 Chat\Chat.h
文件 74752 2011-07-20 15:11 Chat\Chat.ncb
文件 56832 2011-07-20 15:11 Chat\Chat.opt
文件 685 2011-07-20 14:58 Chat\Chat.plg
文件 6361 2011-07-19 21:26 Chat\Chat.rc
文件 16841 2011-07-20 14:58 Chat\ChatDlg.cpp
文件 2461 2011-07-19 21:44 Chat\ChatDlg.h
文件 1790 2011-07-12 21:49 Chat\color.ico
目录 0 2011-07-19 19:27 Chat\Debug\
文件 5555200 2011-07-20 14:58 Chat\Debug\Chat.bsc
文件 127015 2011-07-20 14:58 Chat\Debug\Chat.exe
文件 387884 2011-07-20 14:58 Chat\Debug\Chat.ilk
文件 14065 2011-07-19 21:45 Chat\Debug\Chat.obj
文件 7117276 2011-07-19 15:41 Chat\Debug\Chat.pch
文件 451584 2011-07-20 14:58 Chat\Debug\Chat.pdb
文件 10124 2011-07-19 21:27 Chat\Debug\Chat.res
文件 0 2011-07-19 21:45 Chat\Debug\Chat.sbr
文件 56896 2011-07-20 14:58 Chat\Debug\ChatDlg.obj
文件 0 2011-07-20 14:58 Chat\Debug\ChatDlg.sbr
文件 111613 2011-07-19 15:41 Chat\Debug\StdAfx.obj
文件 1413974 2011-07-19 15:41 Chat\Debug\StdAfx.sbr
文件 222208 2011-07-20 14:58 Chat\Debug\vc60.idb
文件 380928 2011-07-20 14:58 Chat\Debug\vc60.pdb
............此处省略8个文件信息
- 上一篇:完整的C++文字游戏
- 下一篇:C语言编写的跨平台线程库
相关资源
- mfc 调用redis
- MFC视频播放器源码(支持avi/wma/mp3等格
- mfc绘图大全(画直线、矩形、椭圆)
- MFC控件重绘
- Qt TCP聊天室demo
- hook,捕获所有案件,查找所有窗口,
- (学习)VS2010之MFC入门到精通教程
- MFC文档_视图_框架_模板结构体系深入
- 简单员工管理系统(适合初学MFC)
- MFC五子棋游戏
- MFC UDP编程
- MFC的异步网络通讯应用程序
- C++MFC模块讲解,黑发程序员课程整理
- 一个简单而强大的基于MFC的web server源
- 基于MFC的VC++仿QQ浏览器源码(雏形)
- MFCaccess.rar
- VC++MFC课程设计的学生成绩管理系统
- MFC 日历控件 万年历 Calendar自绘
- CrystalDiskInfo-HDD/SSD硬盘信息,SMART信息
- MFC自定义界面HUI,高效简单,含详细
- 仿射密码-Affine cipher
- c++MFC车牌自动识别定位,只能定位和
- mfc+sql 酒店客房管理系统
- 基于图割的图像分割OpenCV+MFC实现
- MFC绘制Bezier曲线B样条曲线曲线拟合
- MFC坦克大战
- VC++ 中国象棋经典游戏源代码
- 课程设计: MFC 学生信息管理系统
- MFC对ACCESS数据库的增加、删除、查找
- vc.6.0 MFC 人事管理系统源码
评论
共有 条评论