How can I know in which format the message is writing, vb6 or c#?

G

Guest

Hi all

I use C# to read messages from msmq queue.
When I knew that it is writing in c# I can read it.
When I knew that it is writing in VB6 I can read it.
How can I know in which format the message is writing?

Moti.
 
N

Nicholas Paldino [.NET/C# MVP]

Moti,

You should only be writing one type of message to the queue. The way
queues are set up, they are pretty much application specific, and the format
of the messages running through them should be well-defined.

Hope this helps.
 
G

Guest

Hi Nicholas

My queue get messages from VB6 and from C#, there are well-defined, but
if you send a message in vb6, you have to Transleate the msg body string to
UTF8.
Can I have a way to know from which type (vb6 or c#) I receive the message?
I try know the by using the mess.Body string format? (how?)
Is that the way? Is there are a better way?

Moti




Nicholas Paldino said:
Moti,

You should only be writing one type of message to the queue. The way
queues are set up, they are pretty much application specific, and the format
of the messages running through them should be well-defined.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Moti said:
Hi all

I use C# to read messages from msmq queue.
When I knew that it is writing in c# I can read it.
When I knew that it is writing in VB6 I can read it.
How can I know in which format the message is writing?

Moti.
 
N

Nicholas Paldino [.NET/C# MVP]

Moti,

If the original application is VB, then you should set the Formatter
property on the MessageQueue class to an instance of the
ActiveXMessageFormatter class. This should translate the messages from VB
correctly.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Moti said:
Hi Nicholas

My queue get messages from VB6 and from C#, there are well-defined, but
if you send a message in vb6, you have to Transleate the msg body string
to
UTF8.
Can I have a way to know from which type (vb6 or c#) I receive the
message?
I try know the by using the mess.Body string format? (how?)
Is that the way? Is there are a better way?

Moti




Nicholas Paldino said:
Moti,

You should only be writing one type of message to the queue. The way
queues are set up, they are pretty much application specific, and the
format
of the messages running through them should be well-defined.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Moti said:
Hi all

I use C# to read messages from msmq queue.
When I knew that it is writing in c# I can read it.
When I knew that it is writing in VB6 I can read it.
How can I know in which format the message is writing?

Moti.
 
G

Guest

Hi Nicholas

The application is in c#, but I get messages from c# + vb6 aplication!
If I know which application send it I can read it, but How can i know how
send it?

Moti Saba

Nicholas Paldino said:
Moti,

If the original application is VB, then you should set the Formatter
property on the MessageQueue class to an instance of the
ActiveXMessageFormatter class. This should translate the messages from VB
correctly.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Moti said:
Hi Nicholas

My queue get messages from VB6 and from C#, there are well-defined, but
if you send a message in vb6, you have to Transleate the msg body string
to
UTF8.
Can I have a way to know from which type (vb6 or c#) I receive the
message?
I try know the by using the mess.Body string format? (how?)
Is that the way? Is there are a better way?

Moti




Nicholas Paldino said:
Moti,

You should only be writing one type of message to the queue. The way
queues are set up, they are pretty much application specific, and the
format
of the messages running through them should be well-defined.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi all

I use C# to read messages from msmq queue.
When I knew that it is writing in c# I can read it.
When I knew that it is writing in VB6 I can read it.
How can I know in which format the message is writing?

Moti.
 
Q

QWERTY

You can try reading vb6 format then catch the exception if the message
is not in vb6 format then read it in c# format.
 
G

Guest

Hi QWERTY

Sorry on the late answer.

I looking for more elegant way…. But so far I think this is the only way….


Thank you

Moti
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top