MSMQ message from VB 6

K

Kimmo Laine

Hi,

what kind of formatter should i use (in C#) when i send message from VB 6
like this

Dim Dest As New MSMQDestination
Dim Msg As New MSMQMessage
Dest.PathName = ".\PRIVATE$\TestQueue"
Msg.Body = "Hello!"
Msg.Send Dest


private void OnReceiveCompleted(object sender, ReceiveCompletedEventArgs
e) {

try {
MessageQueue q = (MessageQueue)sender;
System.Messaging.Message m = q.EndReceive(e.AsyncResult);

// . . .

string s = (string)m.Body;

q.BeginReceive();
} catch ( Exception exc ) {
Debug.WriteLine( exc.Message );
}
}



thx

Kimmo Laine
 
G

Guest

VB6 (and other COM applications) will use an ActiveXMessageFormatter. Therefore if you are receiving messages from a VB 6 app in C#, or sending messages from C# to VB 6 use this formatter

Dan
 

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