基于TCP协议VC++6.0实现的聊天程序


基于TCP协议的聊天程序,用VC6.0 编写服务器与客户端之间的简单通信工具。
资源截图
代码片段和文件信息
// CSocketcli.cpp : Defines the class behaviors for the application.
//

#include “stdafx.h“
#include “CSocketcli.h“
#include “CSocketcliDlg.h“

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

/////////////////////////////////////////////////////////////////////////////
// CCSocketcliApp

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

/////////////////////////////////////////////////////////////////////////////
// CCSocketcliApp construction

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

/////////////////////////////////////////////////////////////////////////////
// The one and only CCSocketcliApp object

CCSocketcliApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CCSocketcliApp initialization

BOOL CCSocketcliApp::InitInstance()
{
if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}
 //   SetDialogBkColor(RGB(189252202));
SetDialogBkColor(RGB(240252240)RGB(25500)); //更改对话框背景颜色 以及文本颜色
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

CCSocketcliDlg 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;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      21592  2012-01-06 20:10  TCP聊天程序TCP聊天客户端CSocketcli.aps

     文件       1566  2012-01-06 20:10  TCP聊天程序TCP聊天客户端CSocketcli.clw

     文件       2339  2012-01-06 19:29  TCP聊天程序TCP聊天客户端CSocketcli.cpp

     文件       4275  2002-09-18 11:04  TCP聊天程序TCP聊天客户端CSocketcli.dsp

     文件        543  2001-03-08 06:56  TCP聊天程序TCP聊天客户端CSocketcli.dsw

     文件       1368  2001-03-08 06:56  TCP聊天程序TCP聊天客户端CSocketcli.h

     文件     140288  2012-01-06 20:10  TCP聊天程序TCP聊天客户端CSocketcli.ncb

     文件      65024  2012-01-06 20:10  TCP聊天程序TCP聊天客户端CSocketcli.opt

     文件       1638  2012-01-06 20:10  TCP聊天程序TCP聊天客户端CSocketcli.plg

     文件       6463  2012-01-06 19:58  TCP聊天程序TCP聊天客户端CSocketcli.rc

     文件       8700  2012-01-06 19:54  TCP聊天程序TCP聊天客户端CSocketcliDlg.cpp

     文件       1703  2012-01-05 20:05  TCP聊天程序TCP聊天客户端CSocketcliDlg.h

     文件      53248  2012-01-06 20:10  TCP聊天程序TCP聊天客户端DebugCSocketcli.exe

     文件     233828  2012-01-06 20:10  TCP聊天程序TCP聊天客户端DebugCSocketcli.ilk

     文件      12816  2012-01-06 20:10  TCP聊天程序TCP聊天客户端DebugCSocketcli.obj

     文件    5572320  2012-01-06 20:10  TCP聊天程序TCP聊天客户端DebugCSocketcli.pch

     文件       3196  2012-01-06 20:10  TCP聊天程序TCP聊天客户端DebugCSocketcli.res

     文件      49753  2012-01-06 20:10  TCP聊天程序TCP聊天客户端DebugCSocketcliDlg.obj

     文件     106399  2012-01-06 20:10  TCP聊天程序TCP聊天客户端DebugStdAfx.obj

     文件     205824  2012-01-06 20:10  TCP聊天程序TCP聊天客户端Debugvc60.idb

     文件     364544  2012-01-06 20:10  TCP聊天程序TCP聊天客户端Debugvc60.pdb

     文件       3651  2001-03-08 06:56  TCP聊天程序TCP聊天客户端ReadMe.txt

     文件       1078  2001-03-08 06:56  TCP聊天程序TCP聊天客户端
esCSocketcli.ico

     文件        402  2001-03-08 06:56  TCP聊天程序TCP聊天客户端
esCSocketcli.rc2

     文件       1101  2012-01-06 19:57  TCP聊天程序TCP聊天客户端
esource.h

     文件        212  2001-03-08 06:56  TCP聊天程序TCP聊天客户端StdAfx.cpp

     文件       1102  2002-09-24 01:24  TCP聊天程序TCP聊天客户端StdAfx.h

     文件        650  2012-01-05 20:01  TCP聊天程序TCP聊天客户端Time.h

     文件      36232  2012-01-06 19:47  TCP聊天程序TCP聊天服务器端CSocket.aps

     文件       1363  2012-01-06 20:10  TCP聊天程序TCP聊天服务器端CSocket.clw

............此处省略42个文件信息

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

发表评论

评论列表(条)