-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPROTOSET.cpp
79 lines (57 loc) · 1.16 KB
/
PROTOSET.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// PROTOSET.cpp : 实现文件
//
#include "stdafx.h"
#include "zhuabao.h"
#include "PROTOSET.h"
#include "afxdialogex.h"
CString protolsit[] =
{
"ip",
"ip and tcp",
"ip and udp",
"arp",
"rarp",
NULL
};
// PROTOSET 对话框
IMPLEMENT_DYNAMIC(ProtoSet, CDialogEx)
ProtoSet::ProtoSet(CWnd* pParent /*=NULL*/)
: CDialogEx(IDD_PROTOSET, pParent)
{
}
ProtoSet::~ProtoSet()
{
}
void ProtoSet::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_PROTOLIST, m_filterlist);
}
BEGIN_MESSAGE_MAP(ProtoSet, CDialogEx)
ON_BN_CLICKED(IDOK, &ProtoSet::OnBnClickedOk)
END_MESSAGE_MAP()
// PROTOSET 消息处理程序
void ProtoSet::OnBnClickedOk()
{
// TODO: 在此添加控件通知处理程序代码
int i = m_filterlist.GetCurSel();
if (i != LB_ERR)
{
// 这边没办法先硬编码了
i = 5 - i - 1;
theApp.m_filterset = true;
theApp.filter = protolsit[i];
}
CDialogEx::OnOK();
}
BOOL ProtoSet::OnInitDialog()
{
CDialogEx::OnInitDialog();
// TODO: 在此添加额外的初始化
for (int i=0;i<5;i++)
{
m_filterlist.InsertString(0,protolsit[i]);
}
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}