Call a function in a shared library: Difference between revisions
Content added Content deleted
(→{{header|Lua}}: added Lua solution) |
|||
Line 1,266: | Line 1,266: | ||
end if</lang> |
end if</lang> |
||
=={{header|Lua}}== |
|||
There is no built-in mechanism, but several external library options exist. Here, the alien library is used to display a message box via the Win32 API. |
|||
<lang lua>alien = require("alien") |
|||
msgbox = alien.User32.MessageBoxA |
|||
msgbox:types({ ret='long', abi='stdcall', 'long', 'string', 'string', 'long' }) |
|||
retval = msgbox(0, 'Please press Yes, No or Cancel', 'The Title', 3) |
|||
print(retval) --> 6, 7 or 2</lang> |
|||
=={{header|Maple}}== |
=={{header|Maple}}== |