vb.net invoke method without (.Me)

Zeus2009
Zeus2009 used Ask the Experts™
on
Hi All,

i am using vb2005 CF.2005

I have a class with which i have an async method and i want to use a delegate to raise an event.
everything works on a form using Me.Invoke(del, receivedString), but when i out it in a class theres obviously no owner.

How can i invoke a delagte without using (.Me)

Thanks
Zeus
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Top Expert 2009
Commented:
You can either:

(1) Pass the Form into your class...not too desirable.
(2) Raise the custom event from the class --> receive it on the form --> use "Me.Invoke" there.

(3) Use the SynchronizationContext class:
http://msdn.microsoft.com/en-us/library/system.threading.synchronizationcontext(VS.80).aspx
* I don't think this is supported in the Compact Framework though.  =(

Author

Commented:
thanks for the feedback

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial