I'll step-through it, and get back to you on this. fairly certain it's:
I have a few questions
on which line does it crash? you can use the angelScript debugger to step through code and figure out exactly where it's crashing.
Data @D = cast<Data@>(A.GetBuffer());though.
As for the sizeof() operator, I'm not (entirely) sure, but why not overload a function in the C++ side like so?
This won't work, as the class is dependent on the script. what i want to achieve is to allow each script to need only the external memory it needs to work. in the past i've built a storage container for this, but it meant doing look-ups to map variables/pointers. i'm hoping to find a way that would allow me to map a point in memory directly to a class.
edit: It's happening with this line:
A.GetBuffer();i'm registering it like so:
ScriptEngine->RegisterObjectMethod("Obj", "ref GetBuffer()", asMETHOD(Obj, GetBuffer), asCALL_THISCALL);edit2:
this is the crash dialog i get:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.line 174: as_callfunc_x86.cpp