我的问题不知道怎么弄的,糊里糊涂就搞定了不得 :)
有人提供CAsyncSocket的源码就给分(要有OnSend()或OnRecv()的啦)
谢谢大家啦!!!!
有人提供CAsyncSocket的源码就给分(要有OnSend()或OnRecv()的啦)
谢谢大家啦!!!!
解决方案 »
- installshield 2010 安装后,电脑重启,总是自动打开system32目录?
- 状态栏问题:自己定义的状态栏pane,显示文字都是灰色的,咋回事?
- formview图片显示不下
- 用VC++ API写窗口,怎么手动添加一个静态文本呀?
- 我用VC做 编辑框回车 出现 编辑框内出现字串http://go.leiju.com 请问如何删除这个
- 如何设置Date Time Picker控件初始值
- VC开发ASP DLL组件遇到的问题?
- 在服务中,为什么ADO连不上ACCESS库?
- 什么是 GIS 啊?
- 找天下奇才
- 急!急!我的IE为什么打不开树形视图
- 我下载了一个.SH 的文件,好象是什么Makefile的文件,但我不知道怎么生成里边的文件
在void CSockRecv::OnReceive(int nErrorCode)中接受数据。
在OnSend中发送数据!
{
// Attributes
public:// Operations
public:
CClientSck();
virtual ~CClientSck();// Overrides
public:
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CClientSck)
public:
virtual void OnReceive(int nErrorCode);
virtual void OnConnect(int nErrorCode);
//}}AFX_VIRTUAL // Generated message map functions
//{{AFX_MSG(CClientSck)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG// Implementation
protected:
};CClientSck::CClientSck()
{
}CClientSck::~CClientSck()
{
}
// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CClientSck, CAsyncSocket)
//{{AFX_MSG_MAP(CClientSck)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif // 0/////////////////////////////////////////////////////////////////////////////
// CClientSck member functionsextern void SetData(LPCTSTR buffer);void CClientSck::OnReceive(int nErrorCode)
{
....// 在这里接受数据
CAsyncSocket::OnReceive(nErrorCode);
}void CClientSck::OnConnect(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
CAsyncSocket::OnConnect(nErrorCode);
if(nErrorCode == 0)
{
...//("SOCKET连接成功。"); }
else
{
... // ("SOCKET连接失败!");
}
}