好像运行不到一半就退出了。但是编译、构件都没问题,执行也没提示错误,就是看不见结果!
/ TCPServer.cpp文件
#include "TCPClient.h"
#include "resource.h"
// 定义网络事件通知消息
#define WM_SOCKET WM_USER + 1
CMyApp theApp;
BOOL CMyApp::InitInstance()
{
// 初始化Winsock库
WSADATA wsaData;
WORD sockVersion = MAKEWORD(2, 0);
::WSAStartup(sockVersion, &wsaData);
// 弹出主窗口对话框
CMainDialog dlg;
m_pMainWnd = &dlg;
dlg.DoModal();
// 释放Winsock库
::WSACleanup();
return FALSE;
}
CMainDialog::CMainDialog(CWnd* pParentWnd):CDialog(IDD_MAINDIALOG, pParentWnd)
{
}
BEGIN_MESSAGE_MAP(CMainDialog, CDialog)
ON_BN_CLICKED(IDC_START, OnStart)
ON_BN_CLICKED(IDC_CLEAR, OnClear)
ON_MESSAGE(WM_SOCKET, OnSocket)
END_MESSAGE_MAP()
BOOL
一流信息监控拦截系统(IMB System)
t);
if(pHost != NULL)
{
CString sIP;
// 得到第一个IP地址
in_addr *addr =(in_addr*) *(pHost->h_addr_list);
// 显示给用户
sIP.Format(" 本机IP:%s", inet_ntoa(addr[0]));
m_bar.SetText(sIP, 0, 0);
}
return TRUE;
}
void CMainDialog::OnStart().......
--------------------next---------------------
阅读(1471) | 评论(0) | 转发(0) |