I've setup my angelscript engine to use std::string as the native string type. (I explained how in the Constructors/Destructors thread.) This works all fine in most cases. One where it doesn't work though is if I try to send a string as argument to a script function. I do the appropriate SetArguments with a pointer to the std::string and the number of DWORDs (7). In the script the string and all following arguments get trashed. Any idea why?
Never mind this. I had totally misunderstood the stackPos argument.
In the documentation it says: "The position in the stack to set, relative to the function's stack frame. The argument data should be placed on positions starting with 0 and increasing, i.e the first argument on 0, the second on 1, etc."
I interpreted that as stackPos kinda beeing the argument number. The docs don't really tell that it's based on the argument sizes too. (I.e. first argument is at 0, the second may be at 2, etc.) This could surely be clearer.