Im new to angelscript and honestly didnt program in C++ for a while so please be gentle to me ;)
I had no problems getting angelscript integrated in my IDE and stuff, but when i tried around with the ScriptEngine a bit i got a nasty error i cant solve.
My specs are:
Microsoft Visual Studio 2010
Windows 7 (64 bit)
Angelscript 22202
I use Angelscript as a static lib.
The code which does problems is this one ( Broke it down to be shorter. )
[...]
ScriptManager::ScriptManager(void)
{
// Create the script engine
asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);
int r = engine->SetMessageCallback(asFUNCTION(MessageCallback), 0, asCALL_CDECL);
// get the main module ( Or create it...)
main_module=engine->GetModule("main", asGM_ALWAYS_CREATE);
// Register the standard string for use in AngelScript
RegisterStdString(engine);
// Ready.
}
ScriptManager::ScriptManager(std::string name, std::string path, bool dump)
{
// First set up the general stuff we need.
ScriptManager();
// Load the designated file.
std::string script=LoadScriptFile(path);
main_module->AddScriptSection(name.c_str(), script.c_str()); // PROBLEMS HERE
}
The last bit of code (namely: main_module->AddScriptSection(name.c_str(), script.c_str()); ) breaks my application. Visual Studio catchs the Exception. Edit: The messageCallback gives no output.
The debugger tells me that i got memory violation. __vfptr cant be interpreted as it seems.
I would be very gratefull if anyone knew an answer since im pretty much in to learn the AngelScript Scriptengine and language since it seems to fit my needs pretty well.
If you need more information i missed for some reason feel free to ask and i will answer asap.