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

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
 
D

David Wilkinson

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++.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top