# tibemsTopic_Create

Function

## Purpose

Create a topic object.

## C Declaration

    tibems_status tibemsTopic_Create(
        tibemsTopic* topic,
        const char* topicName );

## COBOL Call

    CALL "tibemsTopic_Create"
         USING BY REFERENCE topic,
               BY REFERENCE topicName,
               RETURNING tibems-status
    END-CALL.

Note: `topic` has usage pointer.

## Parameters

Parameter | Description
--- | ---
`topic` | Store the topic object in this location.
`topicName` | Create a local topic instance with this name.

## Remarks

This constructor creates only local objects (within the program). It does not attempt to bind the local topic object to the corresponding server object until the program creates a `tibemsMsgConsumer` or a `tibemsMsgProducer` that uses the topic.

The bind can fail for the following reasons:

- Authorization is enabled for the topic and the user does not have the appropriate permissions.
- The topic does not exist and the server cannot dynamically create the topic.

## See Also

`tibemsLookupContext`

Copyright © Cloud Software Group, Inc. All rights reserved.