Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Menu option executing using threads

2 views
Skip to first unread message

Marek Powichrowski

unread,
Nov 24, 2002, 11:52:04 AM11/24/02
to
Hi all,

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


Ginny Caughey

unread,
Nov 25, 2002, 10:53:06 AM11/25/02
to
Marek,

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...

Marek Powichrowski

unread,
Nov 26, 2002, 2:34:35 AM11/26/02
to

Użytkownik "Ginny Caughey" <ginny....@wasteworks.com> napisał w
wiadomości news:artguu$m5gsp$1...@ID-144704.news.dfncis.de...

> Marek,
>
> 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,

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

Karl Faller

unread,
Nov 26, 2002, 4:32:31 AM11/26/02
to
Marek,
although i don't dare to go near any thread <g>
you should clear your/our thinking:

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

Ginny Caughey

unread,
Nov 26, 2002, 9:11:37 AM11/26/02
to
Marek,

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...

0 new messages