VC6.0 SOCKET编程,消息映射。{莫名跳出。有大神帮看下嘛
// TCP客户Dlg.h : header file
//
#if !defined(AFX_TCPDLG_H__C259476D_BF94_418F_ADF0_1618BA3A3827__INCLUDED_)
#define AFX_TCPDLG_H__C259476D_BF94_418F_ADF0_1618BA3A3827__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define WM_SOCKET WM_USER+100
/////////////////////////////////////////////////////////////////////////////
// CTCPDlg dialog
class CTCPDlg : public CDialog
{
// Construction
public:
CTCPDlg(CWnd* pParent = NULL); // standard constructor
SOCKET s ;
sockaddr_in addr;
// Dialog Data
//{{AFX_DATA(CTCPDlg)
enum { IDD = IDD_TCP_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTCPDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
afx_msg void OnSocket(WPARAM wParam,LPARAM lParam);//自定义消息相应函数
BEGIN_MESSAGE_MAP(CTCPDlg,CDialog) //在消息映射表中将消息与响应函数关联
//{{AFX_MSG_MAP(CTCPDlg)
ON_BN_CLICKED(IDC_CONNECT,OnConnect)
ON_BN_CLICKED(IDC_SEND,OnSend)
ON_MESSAGE(WM_SOCKET,OnSocket)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// HICON m_hIcon;
// Generated message map functions
BEGIN_MESSAGE_MAP(CTCPDlg,CDialog)
//{{AFX_MSG(CTCPDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnConnect();
afx_msg void OnSend();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}//
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TCPDLG_H__C259476D_BF94_418F_ADF0_1618BA3A3827__INCLUDED_)