Sign in to follow this  

luaplus error output

This topic is 3875 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

This topic is 3875 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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