1. c_func
- Posted by dubetyrant at hotmail.com Apr 03, 2003
- 327 views
This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C2F957.9AFCE090 charset="iso-8859-1" Hi, With euphoria's command c_func, how do I call the functions? Do they = have to exist in a .dll?In the same folder? ------=_NextPart_000_0005_01C2F957.9AFCE090 charset="iso-8859-1" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV> <DIV><FONT face=3DArial size=3D2> With euphoria's command c_func, = how do I call=20 the functions? Do they have to exist in a .dll?In the same = folder?</FONT></DIV> <DIV> </DIV> ------=_NextPart_000_0005_01C2F957.9AFCE090--
2. Re: c_func
- Posted by Derek Parnell <ddparnell at bigpond.com> Apr 03, 2003
- 336 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