How to update 'Edit Control' text from Timer Callback.

  • Thread starter Thread starter IdleBrain
  • Start date Start date
I

IdleBrain

Hi,
I need a way to update an Edit control control in MFC from a timer
callback function.
How can that be done as we cannot reference dialog box controls from
callbacks?

Even the following code gives me problems:

VOID CALLBACK TimerProc ( HWND hParent, UINT uMsg, UINT uEventID,
DWORD dwTimer )
{
//Add the text
CEdit *ptrtxtActivity;
ptrtxtActivity = reinterpret_cast<CEdit
*>(GetDlgItem(hParent,txtboxActivity));
ptrtxtActivity->SetWindowText(text);
}

Please let me know,

Thank you,
IdleBrain
 
IdleBrain said:
Hi,
I need a way to update an Edit control control in MFC from a timer
callback function.
How can that be done as we cannot reference dialog box controls from
callbacks?

Even the following code gives me problems:

VOID CALLBACK TimerProc ( HWND hParent, UINT uMsg, UINT uEventID,
DWORD dwTimer )
{
//Add the text
CEdit *ptrtxtActivity;
ptrtxtActivity = reinterpret_cast<CEdit
*>(GetDlgItem(hParent,txtboxActivity));
ptrtxtActivity->SetWindowText(text);
}

Idle:

Please don't multipost. This is an MFC question, and you have answers in
the MFC group.

This group is for managed C++.
 
Back
Top