Re: c_func
- Posted by Derek Parnell <ddparnell at bigpond.com> Apr 03, 2003
- 334 views
On Wed, 2 Apr 2003 20:36:57 -0500, <dubetyrant at hotmail.com> wrote: > > Hi, > With euphoria's command c_func, how do I call the functions? result = c_func( funcid, {parmlist}) > Do they have to exist in a .dll? Yes, for Windows. In a .so file for Linux. > In the same folder? No. You open the DLL first, then get the id of the function inside the DLL. To quote from the Euphoria manual... user32 = open_dll("user32.dll") -- the C function BeginPaint takes a C int argument and -- a C pointer, and returns a C int as a result: BeginPaint = define_c_func(user32, "BeginPaint", {C_INT, C_POINTER}, C_INT) -- call BeginPaint, passing hwnd and ps as the arguments, -- hdc is assigned the result: hdc = c_func(BeginPaint, {hwnd, ps}) -- cheers, Derek Parnell