I'm a newer in CF developing, now i'm confused about the multiplethread
programing. I Created a thread to monitor the powerOff keyEvent, and
inform the Mainthread if the event comes. but it does not work when i
use interface invoke.
so i want to know how can the moniter thread communicate with main
thread.

Re: How can a thread communicate with the main thread? by Paul

Paul
Thu Jul 20 10:16:44 CDT 2006

There are many ways to communicate (global variables, events, both OS and
window). I don't understand what you're saying was the problem. You have
to Control.Invoke() to call a UI method from a non-UI thread, but that's no
big deal.

Paul T.

"steel" <SteelWhite@gmail.com> wrote in message
news:1153388993.147167.139280@b28g2000cwb.googlegroups.com...
> I'm a newer in CF developing, now i'm confused about the multiplethread
> programing. I Created a thread to monitor the powerOff keyEvent, and
> inform the Mainthread if the event comes. but it does not work when i
> use interface invoke.
> so i want to know how can the moniter thread communicate with main
> thread.
>



Re: How can a thread communicate with the main thread? by Fabien

Fabien
Thu Jul 20 11:26:09 CDT 2006

Hi,

I suppose you use CF1.0 and Invoke can't have parameters. A good way to
communicate is to use the MessageQueue of Win CE, to import the
functions CreateMsgQueue... there is a lot of examples of importations
of this functions on the Internet.

BR

Fabien Decret
Windows Embedded consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/



Paul G. Tobey [eMVP] a =E9crit :

> There are many ways to communicate (global variables, events, both OS and
> window). I don't understand what you're saying was the problem. You have
> to Control.Invoke() to call a UI method from a non-UI thread, but that's =
no
> big deal.
>
> Paul T.
>
> "steel" <SteelWhite@gmail.com> wrote in message
> news:1153388993.147167.139280@b28g2000cwb.googlegroups.com...
> > I'm a newer in CF developing, now i'm confused about the multiplethread
> > programing. I Created a thread to monitor the powerOff keyEvent, and
> > inform the Mainthread if the event comes. but it does not work when i
> > use interface invoke.
> > so i want to know how can the moniter thread communicate with main
> > thread.
> >


Re: How can a thread communicate with the main thread? by Paul

Paul
Thu Jul 20 13:11:51 CDT 2006

You can also use properties of the form as 'parameters', as long as only one
thread accesses them at a time, you don't even have to synchronize.

Paul T.

"Fabien" <fab_00_2002@msn.com> wrote in message
news:1153412769.694141.222150@m73g2000cwd.googlegroups.com...
Hi,

I suppose you use CF1.0 and Invoke can't have parameters. A good way to
communicate is to use the MessageQueue of Win CE, to import the
functions CreateMsgQueue... there is a lot of examples of importations
of this functions on the Internet.

BR

Fabien Decret
Windows Embedded consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/



Paul G. Tobey [eMVP] a écrit :

> There are many ways to communicate (global variables, events, both OS and
> window). I don't understand what you're saying was the problem. You have
> to Control.Invoke() to call a UI method from a non-UI thread, but that's
> no
> big deal.
>
> Paul T.
>
> "steel" <SteelWhite@gmail.com> wrote in message
> news:1153388993.147167.139280@b28g2000cwb.googlegroups.com...
> > I'm a newer in CF developing, now i'm confused about the multiplethread
> > programing. I Created a thread to monitor the powerOff keyEvent, and
> > inform the Mainthread if the event comes. but it does not work when i
> > use interface invoke.
> > so i want to know how can the moniter thread communicate with main
> > thread.
> >