[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Suggestion for LoadLibrary in windows
- From: Noel Frankinet <nfr@...>
- Date: Wed, 06 Dec 2006 09:28:40 +0100
Mike Pall a écrit :
LoadLibrary will load dll in system directory before current
directory by default settings.
Quoting MSDN (emphasis mine):
"If the string DOES NOT SPECIFY A PATH, the function uses a
standard search strategy to find the file."
But Lua always specifies a path (i.e. a string containing a
backslash) when using require.
For example, I create a C module named console.dll and put it in
my current directory.
You need to put it into the directory where lua.exe is stored.
This may or may not be the current directory. See the search path
order at the beginning of luaconf.h or 'print(package.cpath)'.
require "console" In lua, it failed.
lua load the console.dll in windows\system32 instead of my
This is strange and shouldn't happen according to the MSDN docs.
Well, unless you've stored lua.exe in windows\system32 ... (don't!)
Can anybody else reproduce this? Which of the package.cpath
components causes this? IMHO ".\\?.dll" should not trigger the
standard search strategy according to the docs.
Some people use Loadlibrary directly and not require.
The suggested flag does not exit on windowsCE.
Gistek Software SA