Jump to content
  • Advertisement
Sign in to follow this  
huaner

luaplus error output

This topic is 4061 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!