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

NextPrevUpTopContentsIndex

4.4.3 Simple Windows example

The script below creates hello.dll .

-------------------- hello.lisp -------------------------
(in-package "CL-USER")
(load-all-patches)
;; 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
  (dll-quit))
 
(deliver nil "hello" 0 :dll-exports '("Hello") :interface :capi)
---------------------------------------------------------

You can build the DLL with this command line:

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

and you can test it with this command line:

rundll32 hello.dll,Hello

4.4.3.1 Using the Application Builder


LispWorks Delivery User Guide - 22 Dec 2009

NextPrevUpTopContentsIndex