Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternate Message Pump

Status
Not open for further replies.

jbs

Programmer
Feb 19, 2000
121
US
I have an application that can take a few minutes to run and is a bit long. For organizational purposes I place the main functions in a separate class out of the main dialog area.

The problem I'm running into is that while a function is running inside of a class I can't use the DoDataExchange method of sending data from the program to the users screen. I want it to arrive inside an editbox.

I can also imagine in the future that if the function working against a large amount of data the user may want to hit the minimize button on the screen. Only problem is that the message to minimize the window will not be received until the function that has focus is completed.

Is there a way to create an alternative message pump that I can place inside my class function that will on occasion look and see if a message is waiting and if so process it.

I also need a way to do a dodataexchange from inside a function that is in a separate class outside of the main data area.

I've got to believe that these two functions are rather common, however I can't find them in the typical books. I suspect that since I'm such a beginner,,,and I am, I'm not searching on the right key-words.

Any help, include sample code, would be GREATLY appreciated.

thanks,

/jbs
 
You don't need to go that dep to modify the way message pumps works.

In my oppinion you need to use multithreading. you will two threads that comunicate between them with the help of events
(some code and information you may find in my answer on Thread116-98265)

One thread will take care of all the calculation/work and will comunicate through events the results to the other thread who owns the message pump.

Anyway, you will have to make a little bit of reading about threads and syncronization functions, these are not something you can learn so quick if you haven't used of it before.

HTH,
s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top