[Ecls-list] New User + A Very Simple Win32 GUI example Pt 2

Juan Jose Garcia Ripoll jlr at mpq.mpg.de
Mon Aug 2 05:07:21 UTC 2004

Brian Algeri wrote:

> Text of the example doc:  [...]
> I am not using the ECL program to generate the c and obj files for
> this example. Not needed for this simple project. I did not need to
> use the compile-file or c:build-program as I was not using the lisp2c
> compiler for this project [...]

Yes, I know it is not required, but it can really simplify your life a 
lot! :-)

Save the following piece of code to a file called "sample.lsp"

(ffi::clines "
#include <windows.h>

(defun message-box (message caption)
  (assert (stringp message))
  (assert (stringp caption))
  (ffi::c-inline (message caption) (:object :object) :int
     "MessageBox(0, (#0)->string.self,(#1)->string.self,

And now type simply:

 > (load "sys:cmp")
 > (compile-file "sample.lsp")
 > (load "sample")
 > (message-box "Hello from ECL Lisp" "Lisp App Message")
 > (quit)

Thanks a lot for posting your inpiring example and feel free to 
contribute some others!
Best regards,


Max-Planck-Institut fuer Quantenoptik	+49/(0)89/32905-345
Hans-Kopfermann-Str. 1, D-85748		www.mpq.mpg.de/Theorygroup/CIRAC/
Garching b. Muenchen, Germany		Juan.Ripoll at mpq.mpg.de

More information about the ecl-devel mailing list