home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.funduc.com
/
2014.08.ftp.funduc.com.tar
/
ftp.funduc.com
/
fshedcode-072212.zip
/
SelectBlockDlg.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2010-09-13
|
3KB
|
94 lines
/////////////////////////////////////////////////////////////////////////////
// License (GPLv2+):
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "fshed.h"
#include "SelectBlockDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSelectBlockDlg dialog
CSelectBlockDlg::CSelectBlockDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSelectBlockDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSelectBlockDlg)
m_strStartOffset = _T("");
m_strEndOffset = _T("");
//}}AFX_DATA_INIT
m_nStartOffset = 0;
m_nEndOffset = 0;
}
void CSelectBlockDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSelectBlockDlg)
DDX_Text(pDX, IDC_START_OFFSET_ED, m_strStartOffset);
//}}AFX_DATA_MAP
if (pDX->m_bSaveAndValidate)
{
if (_stscanf(m_strStartOffset, _T("x%x"), &m_nStartOffset) == 0)
{
if (_stscanf(m_strStartOffset, _T("%d"), &m_nStartOffset) == 0)
{
AfxMessageBox (IDS_ERR_INV_OFFSET);
pDX->Fail();
}
}
}
DDX_Text(pDX, IDC_END_OFFSET_ED, m_strEndOffset);
if (pDX->m_bSaveAndValidate)
{
if (_stscanf(m_strEndOffset, _T("x%x"), &m_nEndOffset) == 0)
{
if (_stscanf(m_strEndOffset, _T("%d"), &m_nEndOffset) == 0)
{
AfxMessageBox (IDS_ERR_INV_OFFSET);
pDX->Fail();
}
}
}
}
BEGIN_MESSAGE_MAP(CSelectBlockDlg, CDialog)
//{{AFX_MSG_MAP(CSelectBlockDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSelectBlockDlg message handlers
BOOL CSelectBlockDlg::OnInitDialog()
{
m_strStartOffset.Format(_T("x%x"), m_nStartOffset);
m_strEndOffset.Format(_T("x%x"), m_nEndOffset);
CDialog::OnInitDialog();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}