|
The last time I did that I used a MODEM.
|
|
|
|
|
this is the first time I'm using message queue, but when trying to crate a message queue it says that message queue is not installed, do i have to install it separately or is it because my local machine is not a server .
|
|
|
|
|
To use message queuing the machine has to be added to an Active Directory domain, and MessageQueuing must be installed at the machine. This is to be found under "Add/remove windows components"
|
|
|
|
|
I'm working on a project where my application (in .net) should communicate with a java-application through MSMQ. By using BinaryMessageFormatter the java application could not deserialize the message, but this worked fine when using XmlMessageFormatter.
The problem is that this java application posts back an XML to the message queue, but i can't read this in any way.
I have the following code:
1 using (MessageQueue mq = new MessageQueue(".\\testQueue"))
2 {
3 mq.Formatter = new XmlMessageFormatter(new Type[] { typeof(string), typeof(XmlDocument), typeof(XmlElement), typeof(XmlDataDocument), typeof(XmlNode) });
4
5 using (Message msg = mq.Receive())
6 {
7 try
8 {
9 object o = msg.Body;
10 Console.WriteLine(o as string);
11 }
12 catch (Exception ex)
13 {
14 Console.WriteLine("Error: " + ex.Message);
15 }
16 finally
17 {
18 Console.ReadKey(true);
19 }
20 }
21 }
I just get an error message "There is an error in XML document (2,1)". Is there any way to "read the raw content" of a message, or any other way to get the content of the message?
The XML in the incoming queue starts like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<StatusSMSMessage xmlns="http://www........./specs/schemas/smsgw/StatusSMSMessage.xsd" mtMessageId="minimalMessage1"><DestinationAddress>
Do I have to implement message queuing from the Windows COM-library? In case; how to do this in .net?
|
|
|
|
|
I don't think you pass the right types.
You need to create your own type, like:
[XmlRoot(Namespace = "http://www........./specs/schemas/smsgw/StatusSMSMessage.xsd")]
class StatusSMSMessage
{
public StatusSMSMessage()
{
}
[XmlAttribute]
public string mtMessageId
{
get { ... }
set { ... }
}
}
And initialize your formatter:
mq.Formatter = new XmlMessageFormatter(new Type[] { typeof(StatusSMSMessage) });
This example is not exhaustive, I would read more on XML serialization if I were you.
|
|
|
|
|
I now have made my own type. The start is like this:
[XmlRoot("StatusSMSMessage", Namespace = "http://www....../specs/schemas/smsgw/StatusSMSMessage.xsd", IsNullable = false)]
public class StatusSMSMessage
{
public StatusSMSMessage() { }
[XmlAttribute("mtMessageId")]
public string mtMessageId;
....
(just removed some of the address inn the Namespace),
And i inizialize my XmlMessageFormatter like this:
using (MessageQueue mq = new MessageQueue(".\\" + qn))
{
mq.Formatter = new XmlMessageFormatter(new Type[] { typeof(StatusSMSMessage) });
...
But when i try to read the message like
object o = message.Body;
I get the message "Root element missing", but i know the message starts with
<?xml version="1.0" encoding="ISO-8859-1"?>
<StatusSMSMessage xmlns=...
I'm totally new at XML Serialization. Does anyone have a clue to why I get this error message?
|
|
|
|
|
Could you paste the entire code for your class? And also the root node of your messge, including the entire namespace?
|
|
|
|
|
Actually I solved it in a different way. Instead i used the ActiveXMessageFormatter, and got the message as plain text, and just used XmlDocument.LoadXml() to get it into an xml document.
Anyway; thanks for your time
|
|
|
|
|
Hello everyone!!!
I need to do a job to college that consists in build a simple file allocation table (FAT) emulator...
The FAT itself will be a simple unidimentional array.. and it just have to do basic operations of a very Basic File System (create, remove, update and delete files)
I´d like to do something ellegant with a friendly GUI containing the array and buttons wich triggers the operations.. Something simple and preety.... Can be C#, C++... C#´s most welcome!!!
Do anyone know something good to start reading about? Someone did somehing like? I´m already searching by the way but found nothing reliable to start....
Thanks
|
|
|
|
|
Operating system ..... any good text book
|
|
|
|
|
not reliable.... just tanembaum and deitel.....
i´d like something more....
|
|
|
|
|
It's not going to be too easy, but a FAT documentation[^] and perhaps some existing (non C#) code should do the job.
FAT is not really complex compared with newer file systems.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi
Does anyone know how to delete an item in a ListBox and then, select the next one or previous one in the listbox?
Currently, I was using the next code:
int index = listBox1.SelectedIndex;
listBox1.Items.RemoveAt(index);
Reestablecer();
int cuenta = listBox1.Items.Count;
if (index < cuenta)
{
index++;
listBox1.SelectedIndex = index;
}
else
{
index--;
listBox1.SelectedIndex = index;
}
but i have a event on SelectedIndexChanged on the ListBox, so when I delete the item in the listbox, automatically the code on the SelectIndexChanged is executed and i get errors because the value of the property listbox.selecteditem is null.
Any ideas of how to solve it?
thanks in advance.
~ Bizarre what men fin attractive ~
|
|
|
|
|
When you have written this code ?
Did you try to catch last removed index value in SelectIndexChanged and manipulated your existing code as you mentioned
int cuenta = listBox1.Items.Count;
if (index < cuenta)
{
index++;
listBox1.SelectedIndex = index;
}
else
{
index--;
listBox1.SelectedIndex = index;
}
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
Your problem is the remove index, when you remove an item you automatically move everything up so don't need to change selected index
|
|
|
|
|
I tried to only remove the item, but the program still executes the selectindexchanged statement.
I get the error NullRefefenceException.
~ Bizarre what men fin attractive ~
|
|
|
|
|
int index = listBox1.SelectedIndex;
if (index >= 0)
{
listBox1.Items.RemoveAt(index);
Reestablecer();
int lastItem = listBox1.Items.Count - 1;
if (index > lastItem)
{
listBox1.SelectedIndex = lastItem;
}
}
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
your code worked fine! Now i just need to check it few more times, because after i delete few items it gets again the null reference exception
thank you
~ Bizarre what men fin attractive ~
|
|
|
|
|
Try this:
int index = listBox1.SelectedIndex;
if (index >= 0)
{
listBox1.Items.RemoveAt(index);
Reestablecer();
int lastItem = listBox1.Items.Count - 1;
if (lastItem >= 0)
{
if (index > lastItem)
{
listBox1.SelectedIndex = lastItem;
}
}
else
{
listBox1.SelectedIndex = -1;
}
}
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Or this:
int index = listBox1.SelectedIndex;
if (index >= 0)
{
listBox1.Items.RemoveAt(index);
Reestablecer();
int lastItem = listBox1.Items.Count - 1;
listBox1.SelectedIndex = Math.Min(lastItem, index);
}
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
I am using a datatable to populate a datagrid in VS2003.
I need to select a row if any cell within the grid is clicked.
I use DataGrid.Select(RowNum) to select the rows & it works on the first selected row, but if i try clicking on any other cells to select a second row, the first selection goes away.
I use ctrl+click for multiple selections.
Can someone help me with the multiple selections.
Thanks.
|
|
|
|
|
Listen, do you mean focus some rows? why that?
query your table to get only those rows in the grid? after all you are creating a condition, to select only 3 rows
Can you focus those rows with a color?
I really dont know how to help i dont know what you are doing! maybe some one can help you there.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hi all
Im trying to create a My favorite folder tab just the one outlook has but i don`t how to write the code for it.
Thank You in advance
|
|
|
|
|
craigMUTOKOKAI wrote: but i don`t how to write the code for it.
Hmmm, yes I can see how that is a problem, for you. What do you think you should do about that?
led mike
|
|
|
|
|
It shouldn't be a problem really, he's already asked how to get email from an exchange server, create a task list and create a calender control like outlook etc, so I expect someone will help him with his college coursework
Bob
Ashfield Consultants Ltd
|
|
|
|