lua-users home
lua-l archive

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


if you really want to do raw, runtime DLL binding, I've got code for you. It can also be done in Linux, BSD etc. via a library but I've noticed this feature got pretty much zero use in LuaX. I don't regret that either, it makes sense to create optimized bindings for the libraries one really wants.

It was intended as an ad-hoc bridging for test automation; where customer DLLs could be tweaked from Lua without the need for a specific binding, or C code.


On Tue, 12 Dec 2006 16:05:54 +0000
 David Given <> wrote:
majkinetor majkinetor wrote:
You mean, I am able to create scripting language for my app that supports C
aside Lua?
Something like asm integration in mainstreem languages, via asm{ ..}
directive ?
Its hard for me to beleive that, can you provide me an example
? Somehow I think we didn't understand eatchother...

I'm not entirely sure what you mean here. A programmer in C can very easily register functions with the Lua VM so that Lua can call out to C, and it's even easier to look up Lua functions and call them from C.

Now, If I don't provide MessageBox wrapper user must be able to do call this
function from adequate Windows DLL.
I supose there is some kind of DllCall() function that alows for this like
in AutoHotKey automatition language:

DllCall("user32.dll\MessageBox", "uint", 0, "uint", .... "str",
"myString".... )

You may be able to do this; it all depends on the way DLLs are called (I'm not a Windows user). I know it is possible to call COM objects in a generic manner
and I'm reasonably sure there's a .net interface.

Applications in windows run in separate process space. You can't access anything from adr space of other process except using specific methods of
code injection so to fool Windows it native code.

But is this necessary to write a Windows window manager? I know that at least on Unix, a window manager is a standalone application that communicates with its child apps via message passing. That may not be true for Windows (I know that if a Windows app stops responding, you suddenly find yourself unable to
move its windows, irritatingly enough).

╭─┈David Given┈─McQ─╮ "Parents let children ride bicycles on the street. │┈┈┈┈│ But parents do not allow children to hear vulgar │(│ words. Therefore we can deduce that cursing is more ╰─┈┈─╯ dangerous than being hit by a car." --- Scott Adams