MQeQMgrGetName

Description
Get the string name of the local queue manager.

Syntax
#include <hmq.h> 
MQEINT32 MQeQMgrGetName( MQEHSESS hSess, 
							MQECHAR * pQMgrName, 
                   	MQEINT32 qmNameLen,  MQEINT32 * pCompCode, 
                   MQEINT32 * pReason) 

Parameters

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

MQECHAR * pQMgrName - output
The output field into which the string name of the local queue manager is copied. If the buffer is NULL, the length of the local queue manager name is returned.

MQEINT32 qmNameLen - input
The buffer size of pQMName. If pQMgrName is NULL, then 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 qmnLen
The length of the queue manager name.

Example
#include <hmq.h>
MQEHSESS  hSess;
MQEINT32  qmLen;
MQECHAR * qm;
MQEINT32  rc,len;
MQEINT32  compcode;
MQEINT32  reason;
 
hSess  = MQeInitialize("MyAppsName", &compcode, &reason);
 
len    = MQeQMgrGetName( hSess, NULL, 0, &compcode, &reason);
qm     = (MQECHAR *) malloc(len+1);
rc     = MQeQMgrGetName( hSess, qm, len, &compcode, &reason);
qm[len] = '\0';
printf("The Queue Manager Name is \"%s\"\n", qm);
MQeTerminate( hSess, &compcode, &reason);


© IBM Corporation 2002. All Rights Reserved