[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: c args to lus?
- From: mark greenlancer <markgreenlancer@...>
- Date: Thu, 12 Aug 2004 09:05:25 +0200
Kevin Baca wrote:
<>No need to reset the stack.
While it's always good to restrict stack growth, lua does clean up the
stack after function calls.
The return value 4 tells lua to take the 4 top-most stack values as the
return values of the function, no matter how large the stack has grown.
okay
<>Not sure about the context surrounding lua_tonumber(this, 1).
What is "this"? Where is the call made?
I also tried only lua_tonumber(1)
The complete error msg is
"s_mainwnd.lua:5: attempt to call global `lua_tonumber' (a nil value)"
The lua source:
-- deskGetDesktopSize(a,b,c,d)
deskGetDesktopSize()
lua_tonumber(1)
deskMainWndMove(200,200,500,500)
The c source
int deskLuaGetDesktopSize(lua_State *l)
{
RECT rc;
GetWindowRect(GetDesktopWindow(), &rc);
//lua_settop(l, 0);
lua_pushnumber(l, rc.left);
lua_pushnumber(l, rc.top);
lua_pushnumber(l, rc.right);
lua_pushnumber(l, rc.bottom);
return 4;
}
mark