Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on an MFC application that ultimately loops through a number of simulation trials after a user has entered the necessary information. The user tells the application how many trials to run. I have the application running from a button which is in a ribbon. This works fine, but nothing is displayed on the screen and the only way you'd know it was running is in task manager. What I would like is for a box to pop up which displays to the user what number trial is running with a progress bar that resets each time a new trial (run) starts....any suggestions? I am using VS2010.
Posted

You can put the MessageBox at the starting of the simulation loop itself. And do update the application UI before continuing. This way you can display the information about trails to the user.

The other solution is, fork a thread and run your trials in those separate threads. Keep synchronizing mechanism to update the information back to the main UI.
 
Share this answer
 
Make sure you run the simulation in a thread separate from the UI thread.
1. Define a custom message.
2. On simulation start up, supply a HWND of your choice (typically your progress dialog) to the thread.
3. Use PostMessage()[^]from your thread to post simulation progress to the window in your UI thread.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900