# mco_fh_mod_create

> Create a module instance.

### Prototype

        mco_fh_ret mco_fh_mod_create(/*IN*/ mco_fh_config_node_h cfg,
                        /*OUT*/ mco_fh_module_h *h)

### Arguments

cfg | A custom module configuration file
h | Output parameter: A module may use it to store private data. This value will be passed to other ModAPI functions. The Feed Handler application does not interpret this handle in any way.

### Description

> This function creates a module instance.

### Return Codes

mco_fh_ret | The status code MCO_FH_OK if successful, otherwise one of the error codes specified in the Feed Handler Return codes page

### Example

        mco_fh_ret mco_fh_mod_create(mco_fh_config_node_h cfg, mco_fh_module_h *h)
        {
            // Create handler object and pass its pointer as a mco_fh_module_h handle to the application.
            // Setup the handler using the configuration.
            TestFeedHandler *handler = new TestFeedHandler;
            if (handler->setup(cfg))
            {
                *h = handler;
                return MCO_FH_OK;
            }
            else
            {
                *h = NULL;
                return MCO_FH_E_INVALID_CONFIG;
            }
        }