473,322 Members | 1,504 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,322 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 3432
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.