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

Control.Invoke

2 views
Skip to first unread message

Lily Chang

unread,
May 22, 2002, 10:44:09 AM5/22/02
to
I have an app that has a dedicated thread (different from the main thread,
which created all my GUI controls during initialization) waiting for
asynchronous
events to occur from the back end service. Upon receiving these events,
the GUI controls need to be updated with new data. My understanding
is that I need to use Control.Invoke to invoke Control methods from
any thread that is not the owner of the control. Since Control.Invoke is
not supported, what is the best way to update control from a non-owning
thread?

Thanks very much.


Alex Yakhnin

unread,
May 22, 2002, 11:05:39 AM5/22/02
to
I've seen a message on this NG saying that the Invoke will
be available for v1.

-Alex

>.
>

Lily Chang

unread,
May 22, 2002, 11:52:21 AM5/22/02
to
I saw an earlier posting from someone asking for this feature,
and a response from MS asking for usage scenario. But I didn't
come across anything from MS saying that Control.Invoke
would be supported in v1. Would you mind pointing me to
that posting?

Thanks very much, Alex.

"Alex Yakhnin" <a.yakhni...@att.net> wrote in message
news:575701c201a2$22ba7550$9ee62ecf@tkmsftngxa05...

Alex Yakhnin

unread,
May 22, 2002, 2:16:52 PM5/22/02
to
This is from CF FAQ:

http://www.gotdotnet.com/team/netcf/FAQ.aspx


"...Q: How do you make calls to Windows Forms objects from
an arbitrary thread
safe way?
A: Control.Invoke allows marshalling of method invokes
from the calling
thread to the thread that owns the control. Control.Invoke
is not supported
in the Beta, but will be supported in the final product.
..."

-Alex

>.
>

Lily Chang

unread,
May 22, 2002, 2:44:23 PM5/22/02
to
Thanks, Alex.

"Alex Yakhnin" <a.yakhn...@att.net> wrote in message
news:63d801c201bc$d93517d0$9ae62ecf@tkmsftngxa02...

Lily Chang

unread,
May 23, 2002, 11:09:56 AM5/23/02
to
So, before version 1.0 is available, can anyone suggest the best way to work
around this
problem?

Thanks very much.

"Lily Chang" <lch...@teltier.com> wrote in message
news:u7uIqGcACHA.992@tkmsftngp02...

Ralph Arvesen

unread,
May 23, 2002, 12:06:46 PM5/23/02
to
This was a major issue for me. I'm using the following work around until V1
is released and I can use the Invoke method.

- Worker thread does something and needs to
update the UI. It raises an event that the UI handles.

- No UI elements can be updated since we are not
on the UI thread. Instead, the worker thread sets
data in a shared class / structure and returns.

- The UI has a timer and it detects the data has been
updated. It processes the data and can update UI
elements since it's on it's own thread.

- I use some sync objects to control access to the
shared data.

--
ralph arvesen

"Lily Chang" <lch...@teltier.com> wrote in message

news:eu97fzmACHA.1916@tkmsftngp04...

Ben Albahari [MS]

unread,
May 24, 2002, 4:46:15 AM5/24/02
to
We plan to support Control.Invoke in the RTM version. In the meantime, the
best way is to use a timer (on the same thread as your GUI controls) to
poll a variable as to whether the asynchronous operation has been completed.

Ben Albahari,
Program Manager,
NET Compact Framework Team

For the most up to date information about frequent user issues, check out
http://www.gotdotnet.com/team/netcf/FAQ.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Reply-To: "Lily Chang" <lch...@teltier.com>
From: "Lily Chang" <lch...@teltier.com>
Subject: Control.Invoke
Date: Wed, 22 May 2002 10:44:09 -0400
Lines: 13
Organization: Teltier Technologies
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <eYBZaAaACHA.2104@tkmsftngp02>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 65.202.44.138
Path: cpmsftngxa07!tkmsftngxs02!cpmsftngxa10!tkmsftngp01!tkmsftngp02
Xref: cpmsftngxa07 microsoft.public.dotnet.framework.compactframework:3398
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Lily Chang

unread,
May 24, 2002, 10:13:34 AM5/24/02
to
Thanks very much, Ralph.

"Ralph Arvesen" <for_em...@springholler.com> wrote in message
news:#RT7ePnACHA.2196@tkmsftngp04...

Seth Demsey [MS]

unread,
Jun 4, 2002, 3:31:12 PM6/4/02
to
Hey --

Control.Invoke will certainly be in the V1.0 release of the compact
framework. Thanks for your patience.

Seth Demsey
Program Manager
.Net Compact Framework

0 new messages