MQeFieldsType

Description
Determines the string name of an MQeFields object. Returns the length of the name (not including the terminating NULL) on success. Returns '0' on error.

Syntax
#include <hmq.h>
MQEINT32 MQeFieldsType( MQEHSESS hSess, MQEHFIELDS hFlds, 
            MQECHAR * pTypeName, MQEINT32 typeLen, 
            MQEINT32 * pCompCode, MQEINT32 * pReason) 

Parameters

MQEHSESS hSess - input
The session handle, returned by MQeInitialize.

MQEHFIELDS hFlds - input
A handle to an MQeFields object.

MQECHAR * pTypeName input and output
The output buffer that the MQeFields object type string name is to be copied into. If NULL, no data is returned.

MQEINT32 typeLen - input
The size of the pTypeName buffer in MQECHAR format. If pTypeName is a NULL, this parameter is ignored.

MQEINT32 * pCompCode - output
MQECC_OK, MQECC_WARNING or MQECC_ERROR.

MQEINT32 * pReason - output
If the returned *pCompCode equals MQECC_ERROR, *pReason may have any of the following values:

MQE_EXCEPT_INVALID_HANDLE

Return Value

MQEINT32
  • On success, returns the length of the type name (not including the terminating NULL).
  • On failure, returns '-1'.

Example
#include <hmq.h>
static MQECHAR const * FieldsType = 
			"com.ibm.mqe.MQeFields";
MQEHSESS  hSess;
MQEINT32  compcode;
MQEINT32  reason;
MQEHFIELDS hFlds;
MQECHAR * pname;
MQEINT32  datalen, rc;
 
hSess  = MQeInitialize("MyAppsName", 
								&compcode, 
								&reason);
hFlds  = MQeFieldsAlloc( hSess, FieldsType, 
									&compcode, 
									&reason);
 
/* Get the length of object type name */
datalen = MQeFieldsType( hSess, hFlds, 0, 
									NULL, 
									&compcode, 
									&reason);
pname  = (MQECHAR *) 
			malloc(datalen+1);
 
/* Get the object type name */
rc   = MQeFieldsType( hSess, hFlds, 
								pname, datalen, 
								&compcode, 
								&reason);
 


© IBM Corporation 2002. All Rights Reserved