From: Berlin B. <ber...@gm...> - 2004-12-14 17:31:56
|
Assume that test-wndclassex is a struct, actually the values are shown below, and (widget-testpointer wnd) widget-testpointer is a C function, defined in a DLL, the exact same struct is defined in C and this function has one argument, a pointer to that particular struct. And I cant seem to pass the reference of that struct to C. And I did already define the callout, in earlier code. DLLIMPORT void widget_testpointer(SOME_STRUCT *ptr) { } ;; Loaded file widget-test.lisp "/// test suite begin ....." *** - #<FOREIGN-ADDRESS #x00000030> cannot be converted to the foreign type FFI:UINT (let ((wnd (make-test-wndclassex :cbSize (widget-sizeof-wnd) :style 0 :lpfnWndProc #'test-wndproc :cbClsExtra 0 :cbWndExtra 0 :hInstance nil :hIcon (widget-defaulticon) :hCursor (widget-defaultcursor) :hbrBackground (widget-defaultbrush) :lpszMenuName "NONE" :lpszClassName "gClassName" :hIconSm (widget-defaulticon) )) ) ;;(print (slot-value wnd 'cbSize)) ;;(print (slot-value wnd 'hIcon)) (widget-testpointer wnd) ;;;; ERROR CAUSED ABOVE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;(widget-testpointer On Tue, 14 Dec 2004 10:50:35 -0500, Sam Steingold <sd...@gn...> wrote: > > * Berlin Brown <oreyva.oebja@tznvy.pbz> [2004-12-14 10:43:09 -0500]: > > > > I am working on a small lisp library using FFI, simple question, I am > > having trouble getting values that have been loaded in lisp and then > > getting them out to a C environment. For example, here is a > > struct(basically a win32 struct) and then I place a variables instance > > in a function in let ... but I keep getting clisp 'foreign-values > > errors' that say I cant convert from lisp to a foreign-value. > > could you please show a _small_ code snippet with the precise error message? > > -- > Sam Steingold (http://www.podval.org/~sds) running w2k > <http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/> > <http://www.mideasttruth.com/> <http://www.honestreporting.com> > Bill Gates is great, as long as `bill' is a verb. > |