• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

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.
0
TZRick
Asked:
TZRick
  • 4
  • 2
1 Solution
 
NipNFriar_TuckCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now