Hey,
I'm using TOM_RUS' WowAddin https://github.com/tomrus88/WowAddin which is working great but I've come across a problem.
I've extended the original source code and added some Lua related functions :
Code:
void(__cdecl * LuaManager::RegisterLuaFunc)(char* functionName, int(__cdecl* function)(lua_State*)) = reinterpret_cast<RegisterFrameFunctionPtr>(REGISTER_LUA_FUNCTION);
int(__cdecl* LuaManager::LuaGetTop)(void* lua_state) = reinterpret_cast<FrameLuaGetTopPtr> (LUA_GETTOP);
void(*LuaManager::DoLuaString) (char const* code) = reinterpret_cast<LuaDoStringPtr>(LUA_DOSTRING);
etc..
I'm calling DoLuaString in a function in the DLL to execute a particular Lua function and while this works upon the player entering the world/logging in, it crashes when I use it while for example a gossip menu is open or closed just yet.
I've did some research and found that DoLuaString indeed crashes if it's used outside the main thread.
If this is indeed the case, how would I be able to call a Lua FrameXML function from the DLL, are there other ways?