Sign in to follow this  
huaner

luaplus error output

Recommended Posts

Hi: i write a class as fellow: class CmllcLuaSERVO { public: CmllcLuaSERVO(LuaStateOwner* p_state) { } virtual ~CmllcLuaSERVO() { } void mMsgBox(const char* m_con) { AfxMessageBox(m_con,MB_OK|MB_ICONQUESTION); } void MsgBox(int a) { CString str; str.Format("%d", a); AfxMessageBox(str,MB_OK|MB_ICONQUESTION); } void SetValue(int a) { m_a = a; } int add(int b) { return(m_a + b); } private: int m_a; }; and register it as fellow: LuaStateOwner m_state; CmllcLuaSERVO m_sys(&m_state); CmllcLuaModule(m_state,"mSystem") .def("mMsgBox", m_sys, &CmllcLuaSERVO::mMsgBox) .def("SetValueA", m_sys, &CmllcLuaSERVO::SetValue) .def("Add", m_sys, &CmllcLuaSERVO::add) .def("MsgBox", m_sys, &CmllcLuaSERVO::MsgBox); m_state->DoFile("testlua.lua"); the scripte of lua is: mSystem.mMsgBox("Starting computing") mSystem.SetValueA(1006) a = mSystem.Add(1006) mSystem.MsgBox(a) where is wrong?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this