how to write menu option execution using threads ? So user can execute next
option before previous option end its execution. Is it possibile ?
TIA,
Marek Powichrowski
It's possible but it's a bit complicated. You use CreateVOThread to create
worker threads. Never update the GUI from a worker thread. I could go on and
on...but start by reading the Microsoft docs on threading and CreateThread.
--
Ginny
"Marek Powichrowski" <mare...@usunto.telbank.pl> wrote in message
news:arr074$5vs$1...@korweta.task.gda.pl...
Ginny,
I know this way but I want to run next option with interacting with GUI
before previous ends its execution. I understand that it is impossibile.
Best wishes,
Marek Powichrowski
a) If your two jobs both need "action" happening in the Gui, i'd say
no, if not impossible but a nightmare
b)
>I know this way but I want to run next option with interacting with GUI
>before previous ends its execution.
If the first option needs "time", i don't think you need more GUI
action than the Menu select to start, or evtl. some following
Userinput. So, you could start from _there_ a new worker thread,
givinng it the input data, and return back to main thread with GUI. If
the next task doesn't need to interact with the workerthread's data,
you could start another, and so on.
If you have to acces the data across thread boundaries you are in for
some complexities <g>
Karl
A safe way to affect the GUI from a worker thread is to use PostMessage to send
the GUI a message. You can also use PostThreadMessage if the GUI needs to
communicate with worker threads. Perhaps that will accomplish your goal? But
definitely do not attempt to do anything on the GUI from a worker thread
directly. This is standard Windows rule.
--
Ginny
"Marek Powichrowski" <mare...@usunto.telbank.pl> wrote in message
news:arv8a0$ipj$1...@korweta.task.gda.pl...