Communication between classes - message queues, etc.?

I have a main windows form that is instantiating a class and calling a method. How can I pass a message from the class to the form so that I can notify the user, obtain a response and then send the response to the class method that is still in execution?

I am looking at message queues, but from the MSDN documentation, I would need WINNT to be able to use the queue. Also, I would like the program to work without having to install Message Queueing.

Any suggestions?

Taarik.
LVL 1
TZRickAsked:
Who is Participating?
 
NipNFriar_TuckConnect With a Mentor Commented:
Use the eventing system...  Here is a link that may help you...

http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_21103613.html#11870943
0
 
TZRickAuthor Commented:
Ahhh... The answer was in front of my nose all the time! I didn't even think of using events! Thank you so much!

Taarik.
0
 
TZRickAuthor Commented:
The post doesn't cover one area though: How can I pass a value back from the form while the other class is executing a method?

That is to say:
  -form launches class
  -class fires event
  -form gets user response
  -form sends response back to class method that is still running and awaiting a response.

Thanks again!

Taarik.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
NipNFriar_TuckCommented:
;-) Properties on an event arg class are by reference.  This means that after the class has fired the event and the form has processed the event (during the processing the form updates a property on the event arg class), the class can access the property on the event args class and use it!  Cool huh? ;-)
0
 
TZRickAuthor Commented:
Ohhh... I see... Awesome! Thanks so much!

Taarik.
0
 
TZRickAuthor Commented:
NipNFriar_Tuck: Your stuff works like a charm! Thanks again!

Taarik.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.