[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: simple Lua alien question
- From: Sebastien Lai <237482@...>
- Date: Mon, 28 Feb 2011 19:19:16 +0100
On Mon, Feb 28, 2011 at 7:07 PM, King, Mike <MKing@klmicrowave.com> wrote:
> Running the following commands causes an access violation when Sleep returns. What am I doing wrong? I'm using the latest version of Lua for Windows (v5.1.4-40).
> require "alien"
> Sleep = alien.kernel32.Sleep
> Sleep:types('void', 'int')
Likely because you declare 'Sleep' as 'void(*)(int)', but Sleep
actually takes a DWORD, which is usually typedef'd to 'double'. More
information at MSDN:
Also, I don't know if that "CONFIDENTIALITY NOTICE" is supposed your
signature or not, but I think it might be a tiny wee bit too long...