NewObject
NewObject create a new object buffer for the give table handle.unsigned int NewObject ( unsigned int tableID, CODBPP::Object *object = NULL, unsigned int variableLength = 0 );
Parameters
| tableID | The table ID defining the table's handle. |
| object | For the returned object addresses |
| variableLength | Optional variable length |
Return Values
If the method succeeds, the return value is zero else see error codes for more details.Remarks
Example Use
#define FIRST_TABLE 1
struct Field{
int first;
double second;
} *field;
char16_t *str = TEXT("new field value"), *message;
CODBPP::Object object;
if((error = database.BeginTransaction()) == NO_ERROR
&& (error = database.OpenTable(FIRST_TABLE)) == NO_ERROR
&& (error = databse.NewObject(FIRST_TABLE,&object,strlen(str))) == NO_ERROR){
field = (stuct Field*)object.fixed;
field->first = 345;
field->second = 678.9;
strcpy(object.variable,str);
if((error = database.AddObject(FIRST_TABLE)) == NO_ERROR)
error= database.CommitTransaction();
}
if(error && database.GetErrorMessage(&message) == NO_ERROR)
MessageBox(message);
database.EndTransaction();

