Link to home
Start Free TrialLog in
Avatar of su_us_76
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

ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wayside
wayside

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.
Avatar of su_us_76

ASKER

Thanks  Andy.