All Manuals > LispWorks Delivery User Guide > 4 Delivering your Application > 4.4 Delivering a dynamic library


4.4.3 Simple Windows example

The script below creates hello.dll .

-------------------- hello.lisp -------------------------
(in-package "CL-USER")
;; The signature of this function is suitable for use with
;; rundll32.exe.
(fli:define-foreign-callable ("Hello"
                              :calling-convention :stdcall)
    ((hwnd w:hwnd)
     (hinst w:hinstance)
     (string :pointer)
     (cmd-show :int))
  (capi:display-message "Hello world")
  ;; quit when library's job is done
(deliver nil "hello" 0 :dll-exports '("Hello") :interface :capi)

You can build the DLL with this command line:

lispworks-6-1-0-x86-win32.exe -build hello.lisp

and you can test it with this command line:

rundll32 hello.dll,Hello Using the Application Builder

LispWorks Delivery User Guide - 13 Dec 2011