📄 mysock.cpp
字号:
// Mysock.cpp : implementation file
//
#include "stdafx.h"
#include "vd.h"
#include "Mysock.h"
#include "VdDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMysock
CMysock::CMysock()
{
}
CMysock::~CMysock()
{
}
// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CMysock, CAsyncSocket)
//{{AFX_MSG_MAP(CMysock)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif // 0
/////////////////////////////////////////////////////////////////////////////
// CMysock member functions
void CMysock::OnReceive(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
/*
char buf[15];
CString Host;
CString strre;
UINT Port;
int RecieveLen;
RecieveLen = this->ReceiveFrom(buf, 15, Host, Port);
buf[RecieveLen] = NULL;
// Copy the message to a CString
strre = buf;
// Add the message to the received list box
//((CVdDlg*)p_dlg)->m_list.AddString(strre);
// Sync the variables with the controls
// ((CVdDlg*)p_dlg)->UpdateData(FALSE);
//if (RecieveLen!=0)
MessageBox("buf",NULL,MB_OK);
//p_dlg->SetDlgItemText(IDC_EDITR,"hello");
CAsyncSocket::OnReceive(nErrorCode);
*/
if (nErrorCode == 0)
// No, call the dialog's OnReceive function
((CVdDlg*)p_dlg)->OnReceive();
}
void CMysock::OnClose(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
CAsyncSocket::OnClose(nErrorCode);
}
void CMysock::SetParent(CDialog *pWnd)
{
p_dlg=pWnd;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -