forked from bigmacd/trapreceiver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMibFileBrowse.cpp
More file actions
55 lines (41 loc) · 1.08 KB
/
MibFileBrowse.cpp
File metadata and controls
55 lines (41 loc) · 1.08 KB
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
#include "stdafx.h"
#include "traprcvr.h"
#include "MibFileBrowse.h"
MibFileBrowse::MibFileBrowse(CWnd* pParent /*=NULL*/)
:CDialog(MibFileBrowse::IDD, pParent)
{
//{{AFX_DATA_INIT(MibFileBrowse)
mMibFilename = _T("");
//}}AFX_DATA_INIT
}
void MibFileBrowse::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(MibFileBrowse)
DDX_Text(pDX, IDC_EDITMIBFILENAME, mMibFilename);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(MibFileBrowse, CDialog)
//{{AFX_MSG_MAP(MibFileBrowse)
ON_BN_CLICKED(IDC_BUTTONBROWSE, OnButtonBrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void
MibFileBrowse::OnButtonBrowse()
{
char dir[256];
GetCurrentDirectory(255, dir);
CString browseTitle = "Mib File Import";
CFileDialog dlg(TRUE,
_T("mib"),
"",
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
_T("MIB Files (*.mib, *.my)|*.mib;*.my|Text File (*.txt)|*.txt|All Files|*.*||"));
dlg.m_ofn.lpstrTitle = browseTitle;
if (dlg.DoModal() == IDOK)
{
mMibFilename = dlg.GetPathName();
}
UpdateData(FALSE);
SetCurrentDirectory(dir);
}