How can I install Window types in lua ?
"鸡肋" <[email protected]> Sat, 31 Mar 2012 10:08:48 +0800
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
Question 1 :
I installed a class member function like below :
member function :
HWND CRenderManager::GetSafeWnd()
{
DCHECK(::IsWindow(m_hWnd));
return m_hWnd;
}
install to lua :
void CRenderManager::InstallToLua( lua_State* luaState )
{
DCHECK(luaState);
using namespace luabind;
module(luaState, "ui")
[
class_<CRenderManager>("RenderManager")
.def("GetSafeWnd", &CRenderManager::GetSafeWnd)
];
}
Now, I use the member function in lua :
function SysButton:OnClose(object)
local render = object:GetRenderManager() -- Get RenderManager installed
render:GetSafeWnd() -- Here is the problem ?
end
When the code step out the member function, it throw an exception like this :
[c]-1(method GetSafeWnd) std::runtime_error: 'Trying to use unregistered class'
Is it because the HWND type should be installed to lua ? I look up MSDN :
typedef HANDLE HWND;typedef PVOID HANDLE;typedef void *PVOID;How can I install Windows types (HWND, HANDLE...) to Lua ?Question 2 :How can I register Windows API (PostMessage、SendMessage、Point) to lua ?
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user