chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Calling routines in kernel32.DLL


From: Thomas Chust
Subject: Re: [Chicken-users] Calling routines in kernel32.DLL
Date: Mon, 10 Jul 2006 21:01:16 +0200

On Sun, 9 Jul 2006, Chess Player wrote:

--- Kon Lovett <address@hidden> wrote:

On Jul 7, 2006, at 6:16 PM, Chess Player wrote:

How would I call the DLL routine "SetConsoleCursorPosition"
in Chicken?

AFAIK you can't. The entire Chicken interface to dynamic loading is
oriented to loading Chicken libraries. [...]

Hello,

I think this comment is only partially true. And CHICKEN certainly does not prevent you from using external C functions in your Scheme code.

You may want to have a look at the lazy-ffi egg (refer to [1] for further information) if you need fully dynamic interfacing to native code. I must admit, though, that I don't know whether lazy-ffi will work on a Windows platform.

What should always work is creating wrappers for the functions you want to import using the builtin foreign function interface of the CHICKEN compiler (refer to section 6 of the manual [2] for further information) and make those wrappers into an extension library which can then be used in both compiled and interpreted code.

cu,
Thomas


[1] http://www.call-with-current-continuation.org/eggs/lazy-ffi.html
[2] 
http://www.call-with-current-continuation.org/manual/Interface-to-external-functions-and-variables.html





reply via email to

[Prev in Thread] Current Thread [Next in Thread]