Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualslicer4ever

Posted 13 June 2013 - 04:42 PM

I have a few questions smile.png
 
on which line does it crash? you can use the angelScript debugger to step through code and figure out exactly where it's crashing.

I'll step-through it, and get back to you on this. fairly certain it's:
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

#4slicer4ever

Posted 13 June 2013 - 04:41 PM

I have a few questions smile.png
 
on which line does it crash? you can use the angelScript debugger to step through code and figure out exactly where it's crashing.

I'll step-through it, and get back to you on this. fairly certain it's:
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.

#3slicer4ever

Posted 13 June 2013 - 04:38 PM

I have a few questions smile.png
 
on which line does it crash? you can use the angelScript debugger to step through code and figure out exactly where it's crashing.

I'll step-through it, and get back to you on this. fairly certain it's:
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);

#2slicer4ever

Posted 13 June 2013 - 04:22 PM

I have a few questions smile.png
 
on which line does it crash? you can use the angelScript debugger to step through code and figure out exactly where it's crashing.

I'll step-through it, and get back to you on this. fairly certain it's:
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.

#1slicer4ever

Posted 13 June 2013 - 12:25 PM

I have a few questions smile.png
 
on which line does it crash? you can use the angelScript debugger to step through code and figure out exactly where it's crashing.

I'll step-through it, and get back to you on this. fairly certain it's:
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 directly to a class.

PARTNERS