lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



I need to module to let my Lua scripts call arbitrary functions in Windows
DLLs. Before I roll my own, has anyone written one already?

Use the dllimport package from here

http://luaforge.net/projects/jaslatrix/

Example:

require"dllimport"
MessageBox = dllimport("USER32","MessageBoxA","i=PPPI")
x = MessageBox(nil, _VERSION, "Hello", 2);
butid = {"OK","CANCEL","ABORT","RETRY","IGNORE","YES","NO"}
MessageBox(nil, "You Clicked " .. butid[x] , "Hello", 0);


Guess that was what you need.

-habib.