Click here to Skip to main content
15,890,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDateTimePicker error debugging Pin
José Luis Sogorb10-Feb-05 6:23
José Luis Sogorb10-Feb-05 6:23 
GeneralRe: DateTimePicker error debugging Pin
Steve Mayfield10-Feb-05 7:08
Steve Mayfield10-Feb-05 7:08 
GeneralRe: DateTimePicker error debugging Pin
José Luis Sogorb10-Feb-05 7:12
José Luis Sogorb10-Feb-05 7:12 
GeneralRe: DateTimePicker error debugging Pin
Steve Mayfield10-Feb-05 7:39
Steve Mayfield10-Feb-05 7:39 
GeneralRe: DateTimePicker error debugging Pin
José Luis Sogorb10-Feb-05 22:18
José Luis Sogorb10-Feb-05 22:18 
GeneralRe: DateTimePicker error debugging Pin
Steve Mayfield12-Feb-05 11:26
Steve Mayfield12-Feb-05 11:26 
GeneralRe: DateTimePicker error debugging Pin
José Luis Sogorb14-Feb-05 4:29
José Luis Sogorb14-Feb-05 4:29 
GeneralRe: DateTimePicker error debugging Pin
Steve Mayfield17-Feb-05 9:53
Steve Mayfield17-Feb-05 9:53 
in the View Class:
...
  CDateTimeDlg dlg;
  CTime timeNewDateTime;

  dlg.m_DateTime = CTime::GetCurrentTime();
  if(dlg.DoModal() == IDOK)
    timeNewDateTime = dlg.m_DateTime;

======================
in the CDateTimeDlg class:
in the .h file:
...
public:
  CDateTimeDlg(CWnd *pParent = NULL);   // standard constructor
  CTime m_DateTime;
  // Dialog Data
  //{{AFX_DATA(CDateTimeDlg)
  enum { IDD = IDD_DATETIME_DLG };
  CDateTimeCtrl m_cDateTime;
  //}}AFX_DATA

in the .cpp file:
...
void CDateTimeDlg::DoDataExchange(CDataExchange* pDX)
{
  CDialog::DoDataExchange(pDX);
  //{{AFX_DATA_MAP(CDateTimeDlg)
  DDX_Control(pDX, IDC_DATETIME, m_cDateTime);
  //}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CDateTimeDlg, CDialog)
  //{{AFX_MSG_MAP(CDateTimeDlg)
  ON_NOTIFY(DTN_DATETIMECHANGE, IDC_DATETIME, OnDatetimechangeDateTime)
  //}}AFX_MSG_MAP
END_MESSAGE_MAP()
...
BOOL CDateTimeDlg::OnInitDialog() 
{
  CDialog::OnInitDialog();

  m_cDateTime.SetFormat("MM/dd/yyyy HH:mm:ss");
  m_cDateTime.SetTime(&m_DateTime);
  return TRUE;  // return TRUE unless you set the focus to a control
                // EXCEPTION: OCX Property Pages should return FALSE
}

void CDateTimeDlg::OnDatetimechangeDateTime(NMHDR *pNMHDR, LRESULT *pResult) 
{
  m_cDateTime.GetTime(m_DateTime);
  *pResult = 0;
}


Steve
GeneralRe: DateTimePicker error debugging Pin
José Luis Sogorb17-Feb-05 21:04
José Luis Sogorb17-Feb-05 21:04 
GeneralRe: DateTimePicker error debugging Pin
José Luis Sogorb17-Feb-05 22:47
José Luis Sogorb17-Feb-05 22:47 
GeneralRe: DateTimePicker error debugging Pin
Steve Mayfield18-Feb-05 10:18
Steve Mayfield18-Feb-05 10:18 
GeneralAccess another dialogs controls Pin
Tombo10-Feb-05 5:31
Tombo10-Feb-05 5:31 
GeneralRe: Access another dialogs controls Pin
rocky_pulley10-Feb-05 5:47
rocky_pulley10-Feb-05 5:47 
GeneralRe: Access another dialogs controls Pin
Tombo10-Feb-05 11:41
Tombo10-Feb-05 11:41 
GeneralDialog's menu gray on startup Pin
rrrado10-Feb-05 4:58
rrrado10-Feb-05 4:58 
GeneralRe: Dialog's menu gray on startup Pin
JKallen11-Feb-05 11:41
JKallen11-Feb-05 11:41 
GeneralCListCtrl Button Pin
rlepine10-Feb-05 4:11
rlepine10-Feb-05 4:11 
GeneralRe: CListCtrl Button Pin
rocky_pulley10-Feb-05 5:04
rocky_pulley10-Feb-05 5:04 
GeneralRe: CListCtrl Button Pin
rlepine10-Feb-05 5:20
rlepine10-Feb-05 5:20 
Generalmsxml 3.0 , used for xml creation , error description Pin
cj_rahul10-Feb-05 3:49
cj_rahul10-Feb-05 3:49 
GeneralRe: msxml 3.0 , used for xml creation , error description Pin
ThatsAlok10-Feb-05 18:54
ThatsAlok10-Feb-05 18:54 
QuestionHow To Get know if Directory Exists? Pin
Rassul Yunussov9-Feb-05 23:37
Rassul Yunussov9-Feb-05 23:37 
AnswerRe: How To Get know if Directory Exists? Pin
Chris Losinger10-Feb-05 3:52
professionalChris Losinger10-Feb-05 3:52 
AnswerRe: How To Get know if Directory Exists? Pin
Blake Miller10-Feb-05 4:18
Blake Miller10-Feb-05 4:18 
AnswerRe: How To Get know if Directory Exists? Pin
Ravi Bhavnani10-Feb-05 6:44
professionalRavi Bhavnani10-Feb-05 6:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.