ctaGetContextInfo

Obtains basic context information.

Prototype

DWORD ctaGetContextInfo ( CTAHD ctahd, CTA_CONTEXT_INFO * info, unsigned size)

Argument

Description

ctahd

Context handle.

info

Pointer to the CTA_CONTEXT_INFO structure:

typedef struct
{
   unsigned size;             /* Size of returned structure    */
   CTAQUEUEHD ctaqueuehd;     /* Natural Access queue handle   */
   unsigned userid;           /* Userid passed back in events  */
   char contextname[CTA_CONTEXT_NAME_LEN];
                              /* Context name                  */
}CTA_CONTEXT_INFO;

size

Size of the CTA_CONTEXT_INFO structure.


Return values

Return value

Description

SUCCESS

 

CTAERR_BAD_ARGUMENT

Invalid info, size, or ctahd parameter.

CTAERR_NOT_INITIALIZED

Natural Access is not initialized. Call ctaInitialize first.

CTAERR_SVR_COMM

Server communication error.


Details

ctaGetContextInfo obtains basic information for the context specified by the ctahd parameter.

See also

ctaGetContextInfoEx

Example

int DemoContextInfo(CTAHD ctahd)
{
        DWORD ret;
        CTA_CONTEXT_INFO info;
        ret = ctaGetContextInfo(ctahd,&info,sizeof(info));
        if ( ret != SUCCESS )
                return ret;
        printf("Context name: %s \n", info.contextname);
        return SUCCESS;
}