Re: Uncertain about luabind

Tomas Cokis <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
I'm afraid I'm still having some trouble, consider this:

struct nLuaVar
{
public:
	
	int* sender;
};

void Raster_Lua_SetupVar(lua_State* Slate)
{
	module(Slate)[
				  class_<nLuaVar>("nLuaVar")
					.def_readwrite("sender", &nLuaVar::sender)
			    ];
}

void Raster_Lua_LoadVar(lua_State* Slate, const char* name, int* variable)
{	
	nLuaVar newValue;
	
	newValue.sender = variable;
	
	globals(Slate)[name] = newValue;
	
}

This seems to be what should work -- A pointer in a structure registered in
a lua module

However, when I go:

Raster_Lua_SetupVar(m_LuaState);

Raster_Lua_LoadVar(m_LuaState, "m_size", &m_size);

luaL_dofile (m_LuaState, filePath.c_str());

where the lua file is

-- Stuff

m_size.sender = 1

--More stuff

Luabind reports an error at that point, and anything after that point in the
luafile does not get done.

Is there something I am doing wrong?
-- 
View this message in context: http://old.nabble.com/Uncertain-about-luabind-tp27160576p27164964.html
Sent from the Lua C++ Bind mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.