home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 January / Pcwk0198.iso / Zadarmo / HEXVIEW / SRC / GOTODLG.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-03  |  1.9 KB  |  70 lines

  1. /* ---------------------------------------------------------------------------
  2.  
  3.    This code can be used as you wish but without warranties as to performance 
  4.    of merchantability or any other warranties whether expressed or implied.
  5.    
  6.      Written by Mike Funduc, Funduc Software Inc. 8/1/96
  7.  
  8.      To download the code and more useful utilities (including Search and
  9.      Replace for Windows 95/NT, 3.1x) go to:
  10.      http://home.sprynet.com/sprynet/funduc  or
  11.      http://ourworld.compuserve.com/homepages/funduc
  12.  
  13. ----------------------------------------------------------------------------*/
  14.  
  15. // GotoDlg.cpp : implementation file
  16. //
  17.  
  18. #include "stdafx.h"
  19. #include "hexview.h"
  20. #include "GotoDlg.h"
  21.  
  22. #ifdef _DEBUG
  23. #define new DEBUG_NEW
  24. #undef THIS_FILE
  25. static char THIS_FILE[] = __FILE__;
  26. #endif
  27.  
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CGotoDlg dialog
  30.  
  31.  
  32. CGotoDlg::CGotoDlg(CWnd* pParent /*=NULL*/)
  33.     : CDialog(CGotoDlg::IDD, pParent)
  34. {
  35.     //{{AFX_DATA_INIT(CGotoDlg)
  36.     m_lNewOffset = 0;
  37.     //}}AFX_DATA_INIT
  38. }
  39.  
  40.  
  41. void CGotoDlg::DoDataExchange(CDataExchange* pDX)
  42. {
  43.     CDialog::DoDataExchange(pDX);
  44.     CString strText;
  45.     //{{AFX_DATA_MAP(CGotoDlg)
  46.     //}}AFX_DATA_MAP
  47.     if (pDX->m_bSaveAndValidate)  // Validating
  48.     {
  49.         DDX_Text(pDX, IDC_OFFSET_ED, strText);
  50.         const char *startptr = (LPCSTR)strText;
  51.         char *endptr;
  52.         m_lNewOffset = strtol(startptr, &endptr, 0);
  53.         if (*endptr != 0) // Not really a number
  54.             m_lNewOffset = -1;
  55.         DDV_MinMaxLong(pDX, m_lNewOffset, 0, 2000000000);
  56.     }
  57.     else                          // Initial display
  58.         DDX_Text(pDX, IDC_OFFSET_ED, m_lNewOffset);
  59. }
  60.  
  61.  
  62. BEGIN_MESSAGE_MAP(CGotoDlg, CDialog)
  63.     //{{AFX_MSG_MAP(CGotoDlg)
  64.         // NOTE: the ClassWizard will add message map macros here
  65.     //}}AFX_MSG_MAP
  66. END_MESSAGE_MAP()
  67.  
  68. /////////////////////////////////////////////////////////////////////////////
  69. // CGotoDlg message handlers
  70.