?
Solved

Communication between classes - message queues, etc.?

Posted on 2004-09-09
6
Medium Priority
?
239 Views
Last Modified: 2010-04-15
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
Comment
Question by:TZRick
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 7

Accepted Solution

by:
NipNFriar_Tuck earned 1000 total points
ID: 12017224
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
 
LVL 1

Author Comment

by:TZRick
ID: 12017254
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
 
LVL 1

Author Comment

by:TZRick
ID: 12017357
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Expert Comment

by:NipNFriar_Tuck
ID: 12017405
;-) 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
 
LVL 1

Author Comment

by:TZRick
ID: 12017436
Ohhh... I see... Awesome! Thanks so much!

Taarik.
0
 
LVL 1

Author Comment

by:TZRick
ID: 12026880
NipNFriar_Tuck: Your stuff works like a charm! Thanks again!

Taarik.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month8 days, 7 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question