how can i execute a delegate on the thread that created the object ?

R

roni

how can i execute a delegate on the thread that created the object ?
(the object is not control, but im looking somthing like the control.invoke
, but to my object)
 
D

Dick Grier

If I understand what you want, just use SomeObject.Invoke (etc.).

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.
 
S

stand__sure

the way that I do this is via BeginInvoke on a delegate that points to
the method. the following snippets are from an article at
http://code.box.sk/newsread.php?newsid=717. Each snippet is from a
different location in the code, but the steps are as follows
0) declare a delegate (pointer) with a specific signature (think c/c++
here)
1) declare a variable of the delegate type
2) instantiate that variable
3) BeginInvoke

Delegate Sub UpdateWeatherSummaryResultsDelegate()
Private _updateWeatherSummaryResultsDelegate As
UpdateWeatherSummaryResultsDelegate

_updateWeatherSummaryResultsDelegate = New
UpdateWeatherSummaryResultsDelegate(AddressOf
UpdateWeatherSummaryResults)

Dim ar As IAsyncResult =
BeginInvoke(_updateWeatherSummaryResultsDelegate, Nothing)
 
G

Guest

Implement invoke method in your object.

Overloads Public Overridable Function Invoke( _
ByVal method As Delegate, _
ByVal args() As Object _
) As Object Implements ISynchronizeInvoke.Invoke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top