Hello,
i have the following C# app, where i send messages to MSMQ:
---
private void button1_Click(object sender, System.EventArgs e) {
const string QNAME = @".\private$\Deltest";
MessageQueue mq = null;
if( MessageQueue.Exists( QNAME ) ) {
mq = new MessageQueue( QNAME );
} else {
mq = MessageQueue.Create( QNAME );
}
mq.Send( "", "HELLO" );
}
---
And then i have VB6 "client" app, which will wait messages from that queue,
and after receiving one, will delete it:
---
Private Sub Command1_Click()
On Error GoTo ErrHandler
Dim resultInfo As New MSMQQueueInfo
resultInfo.PathName = ".\private$\Deltest"
Dim resultQueue As MSMQQueue
Set resultQueue = resultInfo.Open(Access:=MQ_RECEIVE_ACCESS,
ShareMode:=MQ_DENY_NONE)
Dim resultMsg As MSMQMessage
Set resultMsg = resultQueue.Receive(, , False, 500)
resultQueue.Close
resultInfo.Delete
If Not resultMsg Is Nothing Then
MsgBox resultMsg.Label
Else
MsgBox "NULL"
End If
ExitProc:
Set resultMsg = Nothing
Set resultQueue = Nothing
Set resultInfo = Nothing
Exit Sub
ErrHandler:
End Sub
---
My problem is this: the C# app will send the message succesfully only once!
When i try to send the message for the second time, everything seems to work
fine, but the VB app will never recd the message. If i restart the C# app,
it works again, but only once!
thx
Kimmo Laine