473,395 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Message Queues

I have created a program which sends a message to a message Queue called
MyMessage, and it is supposed to recieve it and show on a dataGrid.
When I click to send the message it doesn't seem to send it since I don't
see it in the server explorer and I also don't see it in the data grid
here is the code:
private void DisplayMessages()
{
DataTable messageTable = new DataTable();
messageTable.Columns.Add("Name");
messageTable.Columns.Add("Message");
messageTable.Columns.Add("Priority");
System.Messaging.Message[] messages;
messages = this.MyMessage.GetAllMessages();
System.Messaging.XmlMessageFormatter stringFormatter;
stringFormatter = new System.Messaging.XmlMessageFormatter(
new string[] {"System.String"});
for (int index = 0; index < messages.Length; index++)
{
messages[index].Formatter = stringFormatter;
messageTable.Rows.Add(new string[] {
messages[index].Label,
messages[index].Body.ToString(),
messages[index].Priority.ToString() });
}
messageGrid.DataSource = messageTable;
}
private void sendMessage_Click(object sender, System.EventArgs e)
{
System.Messaging.Message theMessage= new
System.Messaging.Message(this.txtMessage.Text);
theMessage.Label=this.txtName.Text;
if(this.highPriority.Checked)
theMessage.Priority=System.Messaging.MessagePriori ty.Highest;
else
theMessage.Priority=System.Messaging.MessagePriori ty.Normal;
DisplayMessages();
}

private void refreshMessages_Click(object sender, System.EventArgs e)
{
DisplayMessages();
}

private void purgeMessages_Click(object sender, System.EventArgs e)
{
this.MyMessage.Purge();
DisplayMessages();
}
Nov 16 '05 #1
1 3436
Hi Michael:

Are using the MessageQueue class with the Send & Relieve methods? I
don't see where theMessage object in sendMessage_Click is ever sent or
attached to a queue.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 22 Oct 2004 15:23:03 -0700, "Michael"
<Mi*****@discussions.microsoft.com> wrote:
I have created a program which sends a message to a message Queue called
MyMessage, and it is supposed to recieve it and show on a dataGrid.
When I click to send the message it doesn't seem to send it since I don't
see it in the server explorer and I also don't see it in the data grid
here is the code:
private void DisplayMessages()
{
DataTable messageTable = new DataTable();
messageTable.Columns.Add("Name");
messageTable.Columns.Add("Message");
messageTable.Columns.Add("Priority");
System.Messaging.Message[] messages;
messages = this.MyMessage.GetAllMessages();
System.Messaging.XmlMessageFormatter stringFormatter;
stringFormatter = new System.Messaging.XmlMessageFormatter(
new string[] {"System.String"});
for (int index = 0; index < messages.Length; index++)
{
messages[index].Formatter = stringFormatter;
messageTable.Rows.Add(new string[] {
messages[index].Label,
messages[index].Body.ToString(),
messages[index].Priority.ToString() });
}
messageGrid.DataSource = messageTable;
}
private void sendMessage_Click(object sender, System.EventArgs e)
{
System.Messaging.Message theMessage= new
System.Messaging.Message(this.txtMessage.Text);
theMessage.Label=this.txtName.Text;
if(this.highPriority.Checked)
theMessage.Priority=System.Messaging.MessagePriori ty.Highest;
else
theMessage.Priority=System.Messaging.MessagePriori ty.Normal;
DisplayMessages();
}

private void refreshMessages_Click(object sender, System.EventArgs e)
{
DisplayMessages();
}

private void purgeMessages_Click(object sender, System.EventArgs e)
{
this.MyMessage.Purge();
DisplayMessages();
}


Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Aki Niimura | last post by:
Hello everyone. I'm trying to control a program from a Python program using IPC. Although using a socket is a common choice for such applications, I would like to use SysV message queues...
0
by: badtemper | last post by:
Is there any way to use perl or any other programming language to perform a "qchk -A" from a web page and see the listing? My problem is that I manage the network for a medical facility that is...
4
by: Tingo | last post by:
Hi all, Is it possible to create a message queue with a specific ID? I want to do this because I'm trying to write a piece of software which restores communicating processes (which communicate...
1
by: Susan | last post by:
I've had to separate my application into 2 apps. I need to second app to poll the message queue for certain messages from the main app. Does someone have some code on how to do this? I have the...
3
by: Brian Keating | last post by:
hello, doesn anyone know how to deploy message queues? I've got a program which uses message queues and i wish to deploy it, one click deployment in vs2005 doesn't allow me to specify message...
0
by: sam | last post by:
Hi, I have windows services appliaction. Application reads message from MS message queuing. I have short code example below of my application. I have different process points these point have...
0
by: sam | last post by:
Hi, Im using windows froms exe application to read and send messages to private message queues. Using threads how can I keep reading all the messages from MS private message queuing without...
2
by: DBC User | last post by:
Hi All, I am going to develop two application which will talk to each other using MSMQ. I have couple of questions 1. Do we need to install anything extra in client PC to use MSMQ? Since...
1
by: Safalra | last post by:
A long time ago when I used a browser that didn't support the shift or unshift methods of the array object, I came up with an implementation of queues that guaranteed amortised constant time...
1
by: ericstein81 | last post by:
I am trying to write a program that uses three queues for inputs of numbers. The problem i am having is I am not quite sure how to designate the seperate queues. can they be named as queue(a),...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.