// InsertPathDlg.cpp : ±¸Çö ÆÄÀÏÀÔ´Ï´Ù.
|
//
|
|
#include "stdafx.h"
|
#include "LogView.h"
|
#include "InsertPathDlg.h"
|
|
|
// CInsertPathDlg ´ëÈ »óÀÚÀÔ´Ï´Ù.
|
|
IMPLEMENT_DYNAMIC(CInsertPathDlg, CDialog)
|
|
CInsertPathDlg::CInsertPathDlg(CWnd* pParent /*=NULL*/)
|
: CDialog(CInsertPathDlg::IDD, pParent)
|
, m_nLogID(0)
|
, m_strLogName(_T(""))
|
, m_strLogPath(_T(""))
|
{
|
|
}
|
|
CInsertPathDlg::~CInsertPathDlg()
|
{
|
}
|
|
void CInsertPathDlg::DoDataExchange(CDataExchange* pDX)
|
{
|
CDialog::DoDataExchange(pDX);
|
DDX_Text(pDX, IDC_LogID, m_nLogID);
|
DDV_MinMaxInt(pDX, m_nLogID, 0, 99);
|
DDX_Text(pDX, IDC_LogName, m_strLogName);
|
DDX_Text(pDX, IDC_LogPath, m_strLogPath);
|
}
|
|
|
BEGIN_MESSAGE_MAP(CInsertPathDlg, CDialog)
|
ON_BN_CLICKED(IDC_ChoicePath, &CInsertPathDlg::OnBnClickedChoicepath)
|
ON_BN_CLICKED(IDOK, &CInsertPathDlg::OnBnClickedOk)
|
END_MESSAGE_MAP()
|
|
|
// CInsertPathDlg ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù.
|
|
void CInsertPathDlg::OnBnClickedChoicepath()
|
{
|
UpdateData();
|
CString strSelectPath;
|
BROWSEINFO BInfo;
|
TCHAR szBuffer[512];
|
::ZeroMemory(&BInfo, sizeof(BROWSEINFO));
|
::ZeroMemory(szBuffer, 512);
|
|
BInfo.hwndOwner = GetSafeHwnd();
|
BInfo.lpszTitle = _T("·Î±×¸¦ ÀúÀåÇÒ Æú´õ¸¦ ¼±ÅÃÇϼ¼¿ä.");
|
BInfo.ulFlags = BIF_NEWDIALOGSTYLE | BIF_EDITBOX | BIF_RETURNONLYFSDIRS;
|
LPITEMIDLIST pItemidList = ::SHBrowseForFolder(&BInfo);
|
if( pItemidList == NULL)
|
m_strLogPath = _T("");
|
|
::SHGetPathFromIDList(pItemidList, szBuffer);
|
m_strLogPath = szBuffer;
|
|
UpdateData(false);
|
}
|
|
void CInsertPathDlg::OnBnClickedOk()
|
{
|
// TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
UpdateData();
|
|
*m_pRetLogID = m_nLogID;
|
_stprintf_s(m_pRetLogName, 128, _T("%s"), m_strLogName);
|
_stprintf_s(m_pRetLogPath, 128, _T("%s"), m_strLogPath);
|
|
OnOK();
|
}
|
|
bool CInsertPathDlg::SetRetValue(int* LogID, TCHAR* LogName, TCHAR* LogPath)
|
{
|
m_pRetLogID = LogID;
|
m_pRetLogName = LogName;
|
m_pRetLogPath = LogPath;
|
return false;
|
}
|