Hi
I have this structure:
// C code
typedef struct
{
int one;
int two;
string name[MAX_STRING_SIZE];
} _dbRecord;
extern _dbRecord dbRecord;
Which I am importing to the script like so: (error checking removed)
// C code
result = scriptEngine->RegisterObjectType("_dbRecord", sizeof(_dbRecord), asOBJ_CLASS);
result = scriptEngine->RegisterObjectProperty("_dbRecord", "int one", offsetof(_dbRecord,one));
result = scriptEngine->RegisterObjectProperty("_dbRecord", "int two", offsetof(_dbRecord,two));
//
// Char type
result = scriptEngine->RegisterObjectProperty("_dbRecord", "string name[256]", offsetof(_dbRecord,name));
But no matter what I do - I always error out:
16:50:10 > Script: Info: RegisterObjectProperty succeeded.
16:50:10 > Script: Error: Failed to RegisterObjectProperty.
16:50:10 > Script; Error: [ asINVALID_DECLARATION ]
16:50:10 > Couldn't start the script engine. Exiting.
What's the syntax I need to use to pass a 'string' inside a struct to the script?
Thanks