How can I pass HWND parameter in funciton ?
"鸡肋" <[email protected]> Mon, 21 May 2012 20:57:28 +0800
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
I want to install "BOOL PostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) " to lua ?First, I defined a converter of HWND type:
template <>
struct default_converter<HWND>
: native_converter_base<HWND>
{
int compute_score(lua_State* L, int index)
{
return cv.compute_score(L, index);
}
HWND from(lua_State* L, int index)
{
return HWND(lua_tointeger(L, index));
}
void to(lua_State* L, HWND const& x)
{
lua_pushinteger(L, (int)x);
}
default_converter<int> cv;
};
Then, I defined the function like below:
def("PostMessage", &PostMessage)
But, the complier show :
'int luabind::native_converter_base<T>::match(lua_State *,luabind::detail::by_value<T>,int)' : cannot convert parameter 2 from 'luabind::detail::by_pointer<T>' to 'luabind::detail::by_value<T>'
Then, I defined the function like this:
def("PostMessage", &PostMessage, copy(_1))
But it didn't work too!
How can I install the PostMessage function to lua ?
Thanks!
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user