F
Fuelfire
Guest
Good day, everyone! I'm trying to open WebSphere MQ queuе through API function. I want to connect to the queue manager, open a specific queue, put in her message, get the message and then close and disconnect. I installed the WebSphere MQ client 7.5 and downloaded the manual "MQSeries Application Programming Interface". In the process of describing the procedures necessary for me I had a problem. For example, the documentation for the opening queue looks like this: MQOPEN Hconn, ObjDesc, Options, Hobj, CompCode, Reason Declare the parameters as follows: Dim Hconn As Long 'Connection handle' Dim ObjDesc As MQOD 'Object descriptor' Dim Options As Long 'Options that control the action of MQOPEN' Dim Hobj As Long 'Object handle' Dim CompCode As Long 'Completion code' Dim Reason As Long 'Reason code qualifying CompCode' As can be seen the parameter ObjDesc is of type MQOD. MQOD, as specified in the manual, is a structure: Type MQOD StrucId As String*4 'Structure identifier' Version As Long 'Structure version number' ObjectType As Long 'Object type' ObjectName As String*48 'Object name' ObjectQMgrName As String*48 'Object queue manager name' DynamicQName As String*48 'Dynamic queue name' AlternateUserId As String*12 'Alternate user identifier' RecsPresent As Long 'Number of object records present' KnownDestCount As Long 'Number of local queues opened 'successfully' UnknownDestCount As Long 'Number of remote queues opened' 'successfully' InvalidDestCount As Long 'Number of queues that failed to open' ObjectRecOffset As Long 'Offset of first object record 'from start of MQOD' ResponseRecOffset As Long 'Offset of first response record from' 'start of MQOD' ObjectRecPtr As String*32 'Address of first object record' ResponseRecPtr As String*32 'Address of first response record' AlternateSecurityID As String*40 'Alternate security identifier' ResolvedQName As String*48 'Resolved queue name' ResolvedQMgrName As String*48 'Resolved queue manager name' End Type How should I declare the type MQOD? When I compile my program I get error: Could not find source class file MQOD.cls. (12625) DLL datatype must be one of CHARACTER, BYTE, SHORT, UNSIGNED-SHORT, LONG, FLOAT, or DOUBLE (3383) Here, a piece of program with certain procedures: DEFINE VARIABLE QMgrName AS CHAR FORMAT "X(48)" NO-UNDO. /* Name of queue manager */ DEFINE VARIABLE Hconn AS HANDLE NO-UNDO. /* Connection handle */ DEFINE VARIABLE CompCode AS INT NO-UNDO. /* Completion code */ DEFINE VARIABLE Reason AS INT NO-UNDO. /* Reason code qualifying CompCode */ /*connecting to queue manager*/ PROCEDURE MQCONN EXTERNAL "mqic32.DLL": DEFINE INPUT PARAMETER QName AS CHAR NO-UNDO. /*Name of queue manager*/ DEFINE OUTPUT PARAMETER Hconn AS LONG NO-UNDO. /*Connection handle*/ DEFINE OUTPUT PARAMETER CompCode AS LONG NO-UNDO. /*Completion code: MQCC_OK - Successful completion. MQCC_WARNING - Warning (partial completion). MQCC_FAILED - Call failed.*/ DEFINE RETURN PARAMETER Reason AS LONG NO-UNDO. /*Reason code qualifying CompCode*/ END PROCEDURE. /*opening queue*/ PROCEDURE MQOPEN EXTERNAL "mqic32.DLL": DEFINE INPUT PARAMETER Hconn AS LONG NO-UNDO. /*Connection handle*/ DEFINE INPUT-OUTPUT PARAMETER ObjDesc AS MQOD NO-UNDO. /*Object descriptor*/ DEFINE INPUT PARAMETER OPTIONS AS LONG NO-UNDO. /*Options that control the action of MQOPEN*/ DEFINE OUTPUT PARAMETER Hobj AS LONG NO-UNDO. /*Object handle*/ DEFINE OUTPUT PARAMETER CompCode AS LONG NO-UNDO. /*Completion code*/ DEFINE RETURN PARAMETER Reason AS LONG NO-UNDO. /*Reason code qualifying CompCode*/ END PROCEDURE. How to create a class for such a complex data type as MQOD? Thanks.
Continue reading...
Continue reading...