MSMQ message from VB 6

  • Thread starter Thread starter Kimmo Laine
  • Start date Start date
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
 
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
 
Back
Top