Updating Edit Box real time

I'm writing an application in MS Visual C++, Ver 5.0.  Part of this application calls up a Dialog Box with a CheckBox and Edit Box. When the CheckBox is clicked, it reads an A/D port on a PC Board in the computer, and ultimately displays this value in the Edit Box once I've manipulated the raw data into something more meaningful.

My question is: How can I automate this process so that when the Dialog Box is called up, the Edit Box continually updates with new data?

Do I need to use a Timer and another subroutine, or is there a better way?
Thank-You!
dgoernerAsked:
Who is Participating?
 
mikeblasConnect With a Mentor Commented:
> Do I need to use a Timer and another subroutine,

That's probably the most straightforward approach, sure.  Call SetTimer() to create a timer. When the timer message comes, get the value from your A/D port and massage it and display it.

If it takes a long time to massage the data, or if you'd have to block on the results from the A/D driver, you might want to use a separate thread.  In that case, the separate thread could run continuously--posting a message to the dialog when it has a new result to be displayed.

..B ekiM
0
 
dgoernerAuthor Commented:
Hey mikeblas:
Thanks for answering my question so quickly!  I kind of figured that this would be the best approach, was hoping you'd come back and say something like "Oh yea....just type in this ONE command and it'll take care of everything!"
No such luck.

Will give it a whirl and let you know the results if you want?

Thanks again!

dgoerner
0
 
mikeblasCommented:
> No such luck.

Unfortunately, Windows has no UpdateSomeEditBoxFromMyADHardware() API.

 > Will give it a whirl and let you know the results if you want?

If you have follow-up questions, I'd be happy to answer 'em.

..B ekiM
0
All Courses

From novice to tech pro — start learning today.