Posted: Fri Apr 02, 2004 11:44 am Post subject: VB.NET and inquire
Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
Ok I give in.....I have been trying to work out how on earth to get a Qmgr.Inquire working in VB.NET. I am using the following:
Code:
Dim selector As Integer()
selector = New Integer() {1}
Dim Attrs As Integer()
Attrs = New Integer() {0}
Dim cmdq As Byte()
cmdq = New Byte() {1}
selector(0) = MQC.MQCA_COMMAND_INPUT_Q_NAME
Try
qMgr.Inquire(selector, Attrs, cmdq)
Catch ex As MQException
Dim err As String = "Inquire for queue manager failed : " + ex.Message
MsgBox("Error inquiring on queue manager : " & Qmgrname & vbCrLf & "Error is " & err, MsgBoxStyle.Critical, "INITQ Inquire Error")
MsgBox("cmdq(0) = " & cmdq(0) & vbCrLf & "selector(0)= " & selector(0) & vbCrLf & "MQ reason Code=" & ex.reason)
If LogFileCount = True Then
outline = Now & vbTab & "***"
Rlog.WriteLine(outline)
outline = Now & vbTab & "Inquire failed for Qmgr (" & Qmgrname & "). Error is : " & ex.Message
Rlog.WriteLine(outline)
outline = Now & vbTab & "Please Contact System Programming"
Rlog.WriteLine(outline)
outline = Now & vbTab & "***"
Rlog.WriteLine(outline)
CloseLogFile()
End If
Return
End Try
It is throwing an exception of MQRC_CHAR_ATTRS_TOO_SHORT (2008). I think I know why, but I can't increase the length. It looks like chrattrs is defined as BYTE in the class definition so I don't actually understand how to make it any bigger.
Any clues? All help appreciated.
btw this is my first VB.NET development with MQ so be gentle with me
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum