MQCCSID=819
Above is the server has been set up
DC is the server connection channel
192.168.100.228 (2000) is the server IP and listener port
The code is as follows:
OLEObject MQS, QM, Q, MW, MR, PO, GO
String ls_mqmgr, ls_s
The integer I
MQS=CREATE OLEObject//MQSeries Session
QM=CREATE OLEObject//QueueManager
Q=the CREATE OLEObject//Queue
MW=CREATE OLEObject//the Message Written
MR=CREATE OLEObject//Message Read
PO=CREATE OLEOBject//Put options
GO=CREATE OLEOBject//Get the options
I=MQS. ConnectToNewObject (" MQAX200. MqSession ")//see note 1
MessageBox (" ", string (I))
GSB ls_mqmgr="0326"//see note 2
QM=MQS. AccessQueueManager (ls_mqmgr)
Q=QM. AccessQueue (" 032601 b01 ", 16)//see note 3
//WRITE
MW=MQS. AccessMessage
WORLD. MW MessageData="https://bbs.csdn.net/topics/HELLO" + string (CPU ())
PO=MQS. AccessPutMessageOptions ()
Q.P ut (MW, PO)
//READ
MR=MQS. AccessMessage ()
Mr. MessageIdHex=Mr. MessageIdHex//see note 4
GO=MQS. AccessGetMessageOptions ()
Q.G et (MR, GO)
Ls_s=Mr. ReadString (Mr. MessageLength)
MessageBox (MQSeries, ls_s)
Q.c lose ()
QM. Disconnect ()
Always remind the error calling external object function AccessQueueManager forget help solve
Death and so on,
CodePudding user response:
AccessQueueManager statement? Or has an incorrect statement!CodePudding user response:
Recovery is caused by your ConnectToNewObject didn't succeed, you determine what the return value, if successful execution down again