Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Communication between classes - message queues, etc.?

Posted on 2004-09-09
6
Medium Priority
?
240 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
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.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

618 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