Using CAPI from dynamic library
Hi,
Is it possible to use the CAPI from a delivered dynamic library?
I’m on macOS, and while the following code produces a valid dynamic library, calling it (using the rundll program in examples/delivery/dynamic-library) makes the program crash:
2019-08-31 00:57:46.975 rundll[82750:1587011] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.’
So how do I make the code run in the main thread? Is it even possible?
Erik
(fli:define-foreign-callable (capitest :result-type :int)
((argc :int)
(argv (:pointer (:pointer :char))))
(declare (ignore argc argv))
(capi:contain (make-instance 'capi:title-pane :text "Hurrah!"))
0)
(deliver nil
(current-pathname "lib-test" nil)
0
:interface :capi
:dll-exports '("capitest”))
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html