Question about call_function

Залунин Сергей Александрович <[email protected]> Thu, 27 Dec 2012 22:11:29 +0500
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
Hello, Luabind-user.

Next code return error message: exception: luabind::cast_failed at memory location 0x003ff68c..

luabind::call_function<char>(myLuaState, "add", "1", "2")





int _tmain(int argc, _TCHAR* argv[])
{
        // Create a new lua state
        lua_State *myLuaState = lua_open();
 
        // Connect LuaBind to this lua state
        luabind::open(myLuaState);
 
        // Define a lua function that we can call
        luaL_dostring(
                myLuaState,
                "function add(first, second)\n"
                "  return first..second\n"
                "end\n"
                );
        
        cout << "Result: "
                << luabind::call_function<char>(myLuaState, "add", "1", "2")
                << endl;
        lua_close(myLuaState);
        _getch();
}
-- 
С уважением,
 Залунин                          mailto:[email protected]


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user