This function creates a new instance of a database object (without an OID).
MCO_RET classname_new( /*IN*/ mco_trans_h t,
/*OUT*/ classname *handle );
t
MCO_READ_WRITE transaction handle returned by mco_trans_start().handle
class handle.This function will reserve space for a new instance of the class and return a reference to the instance for classes declared without an OID.
MCO_S_OK
MCO_E_ACCESS
MCO_READ_ONLY.MCO_E_TRANSACT
MCO_E_NOMEM
Application snippet:
const char *dbname = "SimpleDb";
int main(int argc, char* argv[])
{
mco_db_h db;
MCO_RET rc;
mco_trans_t t;
...
mco_trans_start(db, MCO_READ_WRITE, MCO_TRANS_FOREGROUND, &t);
if (MCO_S_OK != rc)
{
A a;
rc = A_new(t, &a);
...
}
}