473,508 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

Oct 22 '07 #1
1 2508
IdleBrain wrote:
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++.

--
David Wilkinson
Visual C++ MVP
Oct 22 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2225
by: revolnip | last post by:
As attached is the code : <% Option Explicit dim lngTimer lngTimer = Timer %> <!--#include file="Connect.asp" --> <!--#include file="Settings.asp" --> <!--#include file="Common.asp" -->
4
2642
by: Todd | last post by:
I have an ASP.NET application and I would like to have some code run on the server automatically once a day at a specified time. I create a timer thread to call a simple callback in the...
2
1653
by: Ron | last post by:
Hello, I am trying to create a page that pulls class rosters from an SQLServer database. The roster table definition is: emp_id(pk, fk), sec_id(pk, fk), reg_date and reg_status. Status can be...
1
9158
by: nospamjac | last post by:
Hi, Is there a way to update the text of an asp:label on a webform without refreshing the entire page? What is called by button clicks and other events that refresh a webform control? See the...
25
4029
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
4
3381
by: Jim Hammond | last post by:
It would be udeful to be able to get the current on-screen values from a FormView that is databound to an ObjectDataSource by using a callback instead of a postback. For example: public void...
1
4920
by: Bob | last post by:
Hi, Hope you can help me with this one. I'm at my wits end. I'm trying to create an intelligent edit-box like the excellent "Customer" one at the URL: ...
6
7964
by: Romulo NF | last post by:
Greetings again to everyone, Im back to show this grid componenet i´ve developed. With this grid you can show the data like a normal table, remove the rows that you need, add rows, import data,...
0
7227
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7127
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7331
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7391
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7501
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1564
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.