nRet = (asERetCodes) pScriptEngine->RegisterObjectType("EventProcessStatus", sizeof(EventProcessStatus), asOBJ_VALUE | asOBJ_APP_CLASS_C);assert( nRet >= 0 );nRet = (asERetCodes) pScriptEngine->RegisterObjectBehaviour("EventProcessStatus", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(clsDateDefaultConstructor), asCALL_CDECL_OBJLAST);assert( nRet >= 0 );nRet = (asERetCodes) pScriptEngine->ExecuteString(NULL, "EventProcessStatus a;", NULL);assert( nRet >= 0 );
It gives -17 on the last return value.
what's wrong with it?
Thanks
Quote: Original post by WitchLord
Hmm, I would have hoped that the example code in the manual would show otherwise.
http://www.angelcode.com/angelscript/sdk/docs/manual/doc_register_val_type.html
The idea is that the asOBJ_POD flag is valid together with asOBJ_VALUE, but not with asOBJ_REF. It doesn't say that it is not valid together with the asOBJ_APP_... flags.
I will however see if I can improve the documentation to clarify this a bit more. Thanks for the tip.