Solved

Communication between classes - message queues, etc.?

Posted on 2004-09-09
6
237 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
  • 4
  • 2
6 Comments
 
LVL 7

Accepted Solution

by:
NipNFriar_Tuck earned 250 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
Independent Software Vendors: 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expression Evaluater 3 46
Exception when using Alea null reference in fsharp.core.dll 3 52
"The resource cannot be found" 1 24
c#, case, if 4 19
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…

733 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