Gregory Martin Pfeil <[EMAIL PROTECTED]> writes:

> The issue here is that CFFI doesn't have any way to tell which of the
> DllGetVersion functions you want to call. Both DEFCFUNs are pointing
> at the same name. This is one of the things that UFFI still handles
> better (unless I just haven't been keeping up-to-date with CFFI).
>
> In UFFI, rather than
>
>>    (load-foreign-library "comctl32.dll")
>
> You would say:
>
>       (load-foreign-library "comctl32.dll" :module "comctl")
>       (load-foreign-library "shell32.dll" :module "shell")
>
> then, when defining the functions:
>
>       (def-function ("DllGetVersion" comctl-dll-get-version)  ((info
> :pointer))
>                     :returning HRESULT
>                     :module "comctl")
>
>       (def-function ("DllGetVersion" shell-dll-get-version) ((info :pointer))
>                     :returning HRESULT
>                     :module "shell")
>
> you can see the extra ":module" parameter, which tells it which DLL
> contains the function you want to use. I'm pretty sure it's not
> possible to do anything similar from CFFI.

I believe most/many/some lisp implementations ignore the :MODULE in UFFI.

Cheers,

  -- Nikodemus              Schemer: "Buddha is small, clean, and serious."
                   Lispnik: "Buddha is big, has hairy armpits, and laughs."

_______________________________________________
cffi-devel mailing list
cffi-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel

Reply via email to