enable-events not firing event - msmq

lloydt

New Member
Hello, I'm attempting to utilize msmq in Progress 91d09 (have also tried 10.1.a with same results) and can't seem to get the enable-events call in progress to work. I have been able through automation to send and receive messages, just can't get the "arrived" event to fire in the progress session. Has anyone else had any luck getting enable-events to work (not necessarily with MSMQ but any automation object)? Due to cost, Sonic is not an option at this point and I'm having to go with MSMQ. I'm running on xp sp2 / msmq 3, it does not matter if the queue is local or remote. I'm including the prototype code that I'm using, the message in the event handler never shows even though the message has arrived. If anyone has any insight on this or experience implementing msmq with progress, I would be most appreciative if you could point me in the right direction.

TIA
--Lloyd

/* receive code */
DEF VAR hReqInfo AS COM-HANDLE.
DEF VAR hRspInfo AS COM-HANDLE.
DEF VAR hReqQueue AS COM-HANDLE.
DEF VAR hRspQueue AS COM-HANDLE.
DEF VAR hMsg AS COM-HANDLE.
DEF VAR hRsp AS COM-HANDLE.
DEF VAR hEvnt AS COM-HANDLE.
DEF VAR delay AS INT NO-UNDO INIT 5000.
DEF VAR curser AS INT NO-UNDO INIT 1.
PROCEDURE hEvnt.Arrived :
DEF INPUT PARAMETER Queue AS COM-HANDLE NO-UNDO.
DEF INPUT PARAMETER crsr AS INTEGER NO-UNDO.
MESSAGE "HELLO FROM hEvnt.Arrived!" VIEW-AS ALERT-BOX.
END PROCEDURE.
CREATE "MSMQ.MSMQQueueInfo" hReqInfo.
CREATE "MSMQ.MSMQMessage" hMsg.
CREATE "MSMQ.MSMQEvent" hEvnt.
hReqInfo:FORMATNAME = "DIRECT=OS:mqserver\Private$\Request".
hReqQueue = hReqInfo:OPEN( 1, 0 ).
hReqQueue:EnableNotification
(hEvnt BY-POINTER,
curser by-variant-pointer,
delay BY-variant-pointer).
hReqQueue:ENABLE-EVENTS("hEvnt").
/* end receive code */


/* send code */
DEF VAR hReqInfo AS COM-HANDLE.
DEF VAR hReqQueue AS COM-HANDLE.
DEF VAR hMsg AS COM-HANDLE.
DEF VAR l-cnt AS INT NO-UNDO.
DEF VAR l-body AS CHAR NO-UNDO.
l-body = "This is an MSMQ message".
CREATE "MSMQ.MSMQQueueInfo" hReqInfo.
CREATE "MSMQ.MSMQMessage" hMsg.
hReqInfo:FORMATNAME = "DIRECT=OS:mqserver\Private$\Request".
hReqQueue = hReqInfo:OPEN( 2, 0 ).
hMsg:LABEL = "Progress MSMQ Test" + STRING(l-cnt).
hMsg:Body = l-body.
hMsg:Send( hReqQueue, ).
hReqQueue:CLOSE().

/* end send code */
 
Top