Re: c_func

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu