May 13, 2003 #1 gilmore9 MIS May 13, 2003 2 EG HI All, Can someone describe or show an example of connecting to a queue w/ visual basic and the api mqconnx? Thanks in advance. Mike Gilmore
HI All, Can someone describe or show an example of connecting to a queue w/ visual basic and the api mqconnx? Thanks in advance. Mike Gilmore
May 22, 2003 #2 kjoter Programmer May 22, 2003 2 NO 'An example for you.. Dim ptions As Long ' MQOPEN options Dim od As MQOD ' Object descriptor MQMD_DEFAULTS md md.MsgId = MQRO_NEW_MSG_ID md.ReplyToQ = ReplyQueue md.ReplyToQMgr = ReplyQueueManager If gHcon = 0 Then ' Connect to the default queue manager MQCONN "", gHcon, CompCode, Reason fraPut.cboAPIRC.AddItem "MQCONN: CompCode = " + Str(CompCode) + ", Reason Code = " + Str(Reason), 0 fraPut.cboAPIRC.ListIndex = 0 od.ObjectQMgrName = QueueManager 'inparameter md.MsgId = MQRO_NEW_MSG_ID md.ReplyToQ = ReplyQueue md.ReplyToQMgr = ReplyQueueManager ptions = MQOO_OUTPUT MQOPEN gHcon, od, ptions, gHobj, CompCode, Reason fraPut.cboAPIRC.AddItem "MQOPEN: CompCode = " + Str(CompCode) + ", Reason Code = " + Str(Reason), 0 fraPut.cboAPIRC.ListIndex = 0 'Runs put command 'Dim md As MQMD ' Message descriptor Dim pmo As MQPMO ' MQPUT message options ' Setup MQMD and MQPMO to their respective ' initial values MQMD_DEFAULTS md md.Format = MQFMT_STRING MQPMO_DEFAULTS pmo ' Get message to be "put" from the Put text box Buflen = Len(fraPut.txtPut.Text) Buffer = fraPut.txtPut.Text MQPUT gHcon, gHobj, md, pmo, Buflen, Buffer, CompCode, Reason fraPut.cboAPIRC.AddItem "MQPUT: CompCode = " + Str(CompCode) + ", Reason Code = " + Str(Reason), 0 fraPut.cboAPIRC.ListIndex = 0 Counter = Counter + 1 Upvote 0 Downvote
'An example for you.. Dim ptions As Long ' MQOPEN options Dim od As MQOD ' Object descriptor MQMD_DEFAULTS md md.MsgId = MQRO_NEW_MSG_ID md.ReplyToQ = ReplyQueue md.ReplyToQMgr = ReplyQueueManager If gHcon = 0 Then ' Connect to the default queue manager MQCONN "", gHcon, CompCode, Reason fraPut.cboAPIRC.AddItem "MQCONN: CompCode = " + Str(CompCode) + ", Reason Code = " + Str(Reason), 0 fraPut.cboAPIRC.ListIndex = 0 od.ObjectQMgrName = QueueManager 'inparameter md.MsgId = MQRO_NEW_MSG_ID md.ReplyToQ = ReplyQueue md.ReplyToQMgr = ReplyQueueManager ptions = MQOO_OUTPUT MQOPEN gHcon, od, ptions, gHobj, CompCode, Reason fraPut.cboAPIRC.AddItem "MQOPEN: CompCode = " + Str(CompCode) + ", Reason Code = " + Str(Reason), 0 fraPut.cboAPIRC.ListIndex = 0 'Runs put command 'Dim md As MQMD ' Message descriptor Dim pmo As MQPMO ' MQPUT message options ' Setup MQMD and MQPMO to their respective ' initial values MQMD_DEFAULTS md md.Format = MQFMT_STRING MQPMO_DEFAULTS pmo ' Get message to be "put" from the Put text box Buflen = Len(fraPut.txtPut.Text) Buffer = fraPut.txtPut.Text MQPUT gHcon, gHobj, md, pmo, Buflen, Buffer, CompCode, Reason fraPut.cboAPIRC.AddItem "MQPUT: CompCode = " + Str(CompCode) + ", Reason Code = " + Str(Reason), 0 fraPut.cboAPIRC.ListIndex = 0 Counter = Counter + 1