# mco_uda_get_class_code
RT

> Get the “native” class code.

### Prototype

        MCO_RET mco_uda_get_class_code(	/*IN*/ mco_uda_object_handle_t * obj,
                          /*OUT*/ unsigned short * class_code);

### Arguments

obj | Handle of a UDA object
class_code | The address of a variable to receive the object class code

### Description

This function gets the “native” class code of a UDA object.

### Return Codes

MCO_S_OK | Class code successfully returned
MCO_E_UDA_STRUCT_NOT_CLASS | Invalid object handle

### Example

        Application snippet:

        int main(int argc, char* argv[])
        {
            MCO_RET rc;
            mco_db_h db;
            mco_trans_h t;
            mco_cursor_t csr;
            mco_uda_object_handle_t rec;
            unsigned short rec_class_code;
            ...

            rc = mco_trans_start(db, MCO_READ_ONLY, MCO_TRANS_FOREGROUND, &t);
            if ( MCO_S_OK == rc) {
                rc = mco_uda_cursor(t, rec_struct_no, get_index_no("Record", "tu4"), &csr);
                rc = mco_cursor_first(t, &csr);
                rc = mco_uda_from_cursor(t, &csr, &rec); /* Get object handle from cursor */
                rc = mco_uda_get_class_code(&rec, &rec_class_code);

                ...
                rc = mco_trans_commit(t);
            }
            ...
        }

### Files

Header file:
mcouda.h
Source file:
mcouda.c
Library:
libmcouda.a