Re: Newby questions #2: ffi.load, ffi.metatype, ffi.C

  • From: Dimiter 'malkia' Stanev <malkia@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 01 Jul 2012 09:35:11 -0700

On 7/1/12 5:52 AM, Claire Lewis wrote:
It cannot automatically load any other DLLs you've given on the
linker command line, because AFAIK there's no (easy) way to get
their names.

You can use EnumProcessModules() to get a list of all DLLs currently loaded into a process, but this will include any dynamically loaded ones (which may, or may not, be desirable depending on what the host app is doing...)

- Claire.

Even then, some might not be loaded yet. For example the open file dialog would more and more dlls at it's first run. But in general, yes - it might work.

But still what seems to be most practical (to me), is to call the function from the dll loaded, not ffi.C - e.g. user32.MessageBoxA instead of ffi.C.MessageBoxA

Other related posts: