Advertisement

c# and lua dll

Started by July 20, 2003 11:46 AM
20 comments, last by arthc 21 years, 3 months ago
quote: Original post by Arild Fines
The DllImport attribute allows you to specify the calling convention:

[DllImport( "lua", CallingConvention = CallingConvention.Cdecl )private static extern somefunc( UIntPtr L );  


Unfortunately, C# doesn''t allow you to set the calling convention on a callback(however, MC++ and MSIL does). See the following thread: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=ew6mLkV6BHA.1932%40tkmsftngp03&rnum=1&prev=/groups%3Fq%3Dcalling%2Bconvention%2Bdelegate%2Bgroup%253Amicrosoft.public.dotnet.*%26btnG%3DGoogle%2BSearch%26hl%3Den%26lr%3D%26ie%3DISO-8859-1


AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.


hmm.. i''m don''t really understand this. what does it mean ?
FINALLY! it works!
i changed every function definition in the lua library from "static int func(lua_State *L)" to "static int __stdcall funct(lua_state *L)" and it works! also i changed the lua_CFunction:
// Oldtypedef int (*lua_CFunction)(lua_State *);// Working!typedef int (__stdcall * lua_CFunction)(lua_State *);

This topic is closed to new replies.

Advertisement