su_us_76
asked on
call a function continuously till a button on dialog box is clicked
Hi,
I want a call a function continuously till a button is clicked.
created a dialog resource having a listbox and a button.
as soon as the dialog opens start calling function
return from the function should be placed in list box.
this should continue untill button on dialog is clicked.
I tried putting function in a loop but it freezes the dialog untill the loop is completed.
Iam new to vc++. help me.please
Thanks
Sahaj
I want a call a function continuously till a button is clicked.
created a dialog resource having a listbox and a button.
as soon as the dialog opens start calling function
return from the function should be placed in list box.
this should continue untill button on dialog is clicked.
I tried putting function in a loop but it freezes the dialog untill the loop is completed.
Iam new to vc++. help me.please
Thanks
Sahaj
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could create a thread which will run a loop that calls your function, and post an event back to the dialog when you want to add something in the listbox. You can use a global variable set when the button is pressed to break out of the loop and exit the thread.
ASKER
Thanks Andy.