lua-users home
lua-l archive

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

Hello ,

      In loadlib.c, line 128 :
      HINSTANCE lib = LoadLibrary(path);

      I think using LoadLibraryEx will be better. Like this:


      The reason is the "Dynamic-Link Library Search Order" has
      changed after Windows XP SP2.
      (see )

      LoadLibrary will load dll in system directory before current
      directory by default settings.

      That is , if your module dll has a name the same with a dll in
      windows system directory, require may be failed.

      For example, I create a C module named console.dll and put it in
      my current directory. When I
      require "console" In lua, it failed.
      lua load the console.dll in windows\system32 instead of my
      .\console.dll .

Best regards,

[恢弘志士之气, 不宜妄自菲薄]