lua-users home
lua-l archive

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

At 15:39 18/06/00 -0300, you wrote:
  The use of varargs in lua_newstate() is troublesome on the Windows
platform when building a DLL.  If you want to build a "correct" DLL you
cannot use the C calling convention, thus can't use varargs, thus you can't
export that function.  That makes using Lua a bit difficult!  ;->

We build a standard DLL using Visual C++ and It is working fine. Thus this DLL does not work in Visual Basic and Delphi, because they use the stdcall convention. I do not know if the stdcall convention does not allow varags.

This DLL is builded using a .DEF file with the exported functions. This is not more or less correct than the stdcall convetion.

In fact to use the stdcall convention you have to edit all the declaration and implementation of exported functions. If the we would like to make things easier to VB and Delphi programmers It is interesting to add a define in front of these functions that can be used to change the calling convention.


PS: to test the DLL I had to edit the file LUA.C that must have the following code:

static lua_State *lua_state = 0;