Frequently, when I select Buffer -> Compile in the Editor, the Lispworks crash with the following error:
Application has generated an exception that could not be handled
Process id=0xb2c (2860), Thread id=0xfc0 (4032)
Click OK to terminate the application.
Click CANCEL to debug the application
Is this a bug in LispWorks Personal 4.3.7 ?
No idea. You should give a description about what exactly you're doing and you should send the files you're trying to compile. Please make the example as small and self-contained as possible such that the error is reproducible.
Thanks, Edi.
Of course, below is the code. The first time, I open the code into the Editor and use Buffer --> Compile and all works fine. Later I go to the listener and write some forms like (calculador) or (descripcion-forma *f*).
Later, I make some change on the Editor. For example, in
(let () (defun clicked (&rest args) (declare (ignore args))))
the clicked function is not calling to message-box function
After make the correction I recompile the buffer and LW 4.3.7 crash. However, sometimes I only recompile the specific form, but the LW 4.3.7 crash too.
The code is only for learn to use RNDZL:
(load "C:/Program Files/Xanalys/LispWorks Personal/RDNZL-0.4.4/load.lisp")
(use-package :rdnzl)
(enable-rdnzl-syntax)
(import-types "System.Windows.Forms" "Application" "DockStyle" "Form" "KeyPressEventHandler" "MessageBox" "MessageBoxButtons" "DialogResult" "TextBox" "Button" "Label")
(import-types "System.Drawing" "Point")
(import-type "System.EventHandler")
(use-namespace "System.Windows.Forms") (use-namespace "System.Drawing") (use-namespace "System")
(defun message-box (text &optional (caption "Mensaje")) ;; check if the "OK" button was pressed [Equals [MessageBox.Show text caption [$MessageBoxButtons.OKCancel]] [$DialogResult.OK]]) ;; we want the message box to have "OK" and "Cancel" buttons
(defun saludo () (message-box "Hola mundo!"))
(defun crea-control (tipo &optional (x 0) (y 0) (texto "")) (let ((ctl (new tipo)) (pto (new "Point"))) (setf (property pto "X") x (property pto "Y") y) (setf (property ctl "Location") pto (property ctl "Text") texto (property ctl "Name") tipo) ctl))
(defun procesa-vector () (do-rdnzl-array (i (list-to-rdnzl-array '(1 2 3))) (print (unbox (cast i "System.Int32")))))
(let () (defun clicked (&rest args) (declare (ignore args))))
(defun calculador () (let ((forma (new "Form")) (tb1 (crea-control "TextBox" 0 0)) (tb2 (crea-control "TextBox" 100 0)) (etiq (crea-control "Label" 0 75)) (boton (crea-control "Button" 0 25 "Sume"))) (setf (property forma "Text") "Calculador Lisp en .Net") (invoke (property forma "Controls") "Add" boton) (invoke (property forma "Controls") "Add" tb1) (invoke (property forma "Controls") "Add" tb2) (invoke (property forma "Controls") "Add" etiq) [+Click boton (new "EventHandler" #'clicked)] ;[Application.Run forma] forma))
(defparameter *f* (calculador))
(defun descripcion-forma (forma) (format t "~%Forma ~S" forma) (format t "~%Colección de controles ~S" [%Controls forma]) (format t "~%Número de controles ~d" [%Count [%Controls *f*]]) (dotimes (i [%Count [%Controls *f*]]) (format t "~%Control: ~d, Nombre: ~S" i [%Name [%Item [%Controls *f*] i]])))
The original compilation messages were:
;;; Safety = 3, Speed = 1, Space = 1, Float = 1, Interruptible = 0 ;;; Compilation speed = 1, Debug = 2, Fixnum safety = 3 ;;; Source level debugging is on ;;; Source file recording is on ;;; Cross referencing is on ; (TOP-LEVEL-FORM 1) ; (TOP-LEVEL-FORM 2) ; Loading text file C:\Program Files\Xanalys\LispWorks Personal\RDNZL-0.4.4\load.lisp ; Loading fasl file C:\Program Files\Xanalys\LispWorks Personal\RDNZL-0.4.4\packages.fsl ; Loading fasl file C:\Program Files\Xanalys\LispWorks Personal\RDNZL-0.4.4\specials.fsl ; Loading fasl file C:\Program Files\Xanalys\LispWorks Personal\RDNZL-0.4.4\util.fsl ; Loading fasl file C:\Program Files\Xanalys\LispWorks Personal\RDNZL-0.4.4\port-lw.fsl ; Loading fasl file C:\Program Files\Xanalys\LispWorks Personal\RDNZL-0.4.4\ffi.fsl ; Loading fasl file C:\Program Files\Xanalys\LispWorks Personal\RDNZL-0.4.4\container.fsl ; Loading fasl file C:\Program Files\Xanalys\LispWorks Personal\RDNZL-0.4.4\reader.fsl ; Loading fasl file C:\Program Files\Xanalys\LispWorks Personal\RDNZL-0.4.4\arrays.fsl ; Loading fasl file C:\Program Files\Xanalys\LispWorks Personal\RDNZL-0.4.4\adapter.fsl ; Loading fasl file C:\Program Files\Xanalys\LispWorks Personal\RDNZL-0.4.4\import.fsl ; (TOP-LEVEL-FORM 3) ; (TOP-LEVEL-FORM 4) ; (TOP-LEVEL-FORM 5) ; (TOP-LEVEL-FORM 6) ; (TOP-LEVEL-FORM 7) ; (TOP-LEVEL-FORM 8) ; (TOP-LEVEL-FORM 9) ; (TOP-LEVEL-FORM 10) ; MESSAGE-BOX ; SALUDO ; CREA-CONTROL ; PROCESA-VECTOR ; (TOP-LEVEL-FORM 11) ; CALCULADOR ; (DEFPARAMETER *F*) ; DESCRIPCION-FORMA
---- Done ----
Regards
Francisco Rivera jfrivera56@hotmail.com
-----Original Message----- From: rdnzl-devel-bounces@common-lisp.net [mailto:rdnzl-devel-bounces@common-lisp.net] On Behalf Of rdnzl-devel-request@common-lisp.net Sent: Saturday, December 25, 2004 5:02 AM To: rdnzl-devel@common-lisp.net Subject: rdnzl-devel Digest, Vol 1, Issue 6
Send rdnzl-devel mailing list submissions to rdnzl-devel@common-lisp.net
To subscribe or unsubscribe via the World Wide Web, visit http://common-lisp.net/cgi-bin/mailman/listinfo/rdnzl-devel or, via email, send a message with subject or body 'help' to rdnzl-devel-request@common-lisp.net
You can reach the person managing the list at rdnzl-devel-owner@common-lisp.net
When replying, please edit your Subject line so it is more specific than "Re: Contents of rdnzl-devel digest..."
Today's Topics:
1. RE: rdnzl-devel Digest, Vol 1, Issue 5 (Francisco Rivera) 2. Re: RE: rdnzl-devel Digest, Vol 1, Issue 5 (Edi Weitz) 3. Crash Lispworks Personal 4.3.7 (Francisco Rivera) 4. Re: Crash Lispworks Personal 4.3.7 (Edi Weitz)
----------------------------------------------------------------------
Message: 1 Date: Fri, 24 Dec 2004 10:59:49 -0600 From: "Francisco Rivera" jfrivera56@hotmail.com Subject: [rdnzl-devel] RE: rdnzl-devel Digest, Vol 1, Issue 5 To: rdnzl-devel@common-lisp.net Message-ID: BAY1-DAV131BDB9DDC045F8467FDA6DBA60@phx.gbl Content-Type: text/plain; charset="iso-8859-1"
That was an oversight of mine, sorry. I forgot to specify an external format in port-lw.lisp. Please try the 0.4.4 release which should fix this.
Thanks very much, now is working fine.
At least two things need to be fixed in the code above:
You forgot to import the type "System.EventHandler" which you need. That's actually the cause for the error message - you should have checked the backtrace. Add these two lines:
(import-type "System.EventHandler") (use-namespace "System")
I was using
(import-types "System" "EventHandler") (use-namespace "System")
but then the program cannot be compiled. The error was:
Warning: Returning NULL object from .NET call Error: Type with name "System.EventHandler" not found in assembly "System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". 1 (abort) Return to level 0. 2 Return to top loop level 0.
Merry Christmas.
Regards
Francisco Rivera jfrivera56@hotmail.com
-----Original Message----- From: rdnzl-devel-bounces@common-lisp.net [mailto:rdnzl-devel-bounces@common-lisp.net] On Behalf Of rdnzl-devel-request@common-lisp.net Sent: Friday, December 24, 2004 5:02 AM To: rdnzl-devel@common-lisp.net Subject: rdnzl-devel Digest, Vol 1, Issue 5
Send rdnzl-devel mailing list submissions to rdnzl-devel@common-lisp.net
To subscribe or unsubscribe via the World Wide Web, visit http://common-lisp.net/cgi-bin/mailman/listinfo/rdnzl-devel or, via email, send a message with subject or body 'help' to rdnzl-devel-request@common-lisp.net
You can reach the person managing the list at rdnzl-devel-owner@common-lisp.net
When replying, please edit your Subject line so it is more specific than "Re: Contents of rdnzl-devel digest..."
Today's Topics:
1. Version 0.4.3 (sorry...) (Edi Weitz) 2. Version 0.4.4 (Christmas release) (Edi Weitz) 3. Re: RDNZL (Edi Weitz)
----------------------------------------------------------------------
Message: 1 Date: Thu, 23 Dec 2004 13:37:47 +0100 From: Edi Weitz edi@agharta.de Subject: [rdnzl-devel] Version 0.4.3 (sorry...) To: rdnzl-devel@common-lisp.net, rdnzl-announce@common-lisp.net Message-ID: u3bxxyyuc.fsf@agharta.de Content-Type: text/plain; charset=us-ascii
Changelog:
Version 0.4.3 2004-12-23 Argh!!! Version 0.4.2 included a defective DLL due to a typo
Download:
http://weitz.de/files/RDNZL.tar.gz http://weitz.de/files/RDNZL_cpp.tar.gz
Edi.
------------------------------
Message: 2 Date: Fri, 24 Dec 2004 01:57:04 +0100 From: Edi Weitz edi@agharta.de Subject: [rdnzl-devel] Version 0.4.4 (Christmas release) To: rdnzl-devel@common-lisp.net, rdnzl-announce@common-lisp.net Message-ID: u652ssecf.fsf@agharta.de Content-Type: text/plain; charset=us-ascii
ChangeLog:
Version 0.4.4 2004-12-24 Added correct external encoding to :EF-WC-STRING type in port-lw.lisp (caught by Francisco Rivera) Changed some code examples from LW to AllegroCL
Download:
http://weitz.de/files/RDNZL.tar.gz
Cheers, Edi.
------------------------------
Message: 3 Date: Fri, 24 Dec 2004 02:05:17 +0100 From: Edi Weitz edi@agharta.de Subject: [rdnzl-devel] Re: RDNZL To: "Francisco Rivera" jfrivera56@hotmail.com Cc: rdnzl-devel@common-lisp.net Message-ID: uwtv8qzea.fsf@agharta.de Content-Type: text/plain; charset=iso-8859-1
Hi!
Please use the mailing list for bug reports and questions. Thanks.
On Thu, 23 Dec 2004 16:06:22 -0600, "Francisco Rivera" jfrivera56@hotmail.com wrote:
I have 2 problems:
- with
(defun message-box (text &optional (caption "Message")) [Equals [MessageBox.Show text caption [$MessageBoxButtons.OKCancel]] [$DialogResult.OK]])
the following problems appears when I use Spanish characters:
(message-box "botón")
Error: External format FLI:ASCII-WCHAR got error writing #<Pointer to type FLI::WCHAR-T = #x008B0258> at position 2: Non-ASCII character #\ó.
That was an oversight of mine, sorry. I forgot to specify an external format in port-lw.lisp. Please try the 0.4.4 release which should fix this.
- How I can create a push button event (Click)?
The following is not working:
(use-package :rdnzl)
(enable-rdnzl-syntax)
(import-types "System.Windows.Forms" "Application" "DockStyle" "Form" "KeyPressEventHandler" "MessageBox" "MessageBoxButtons" "DialogResult" "TextBox" "Button" "Label")
(import-types "System.Drawing" "Point") (use-namespace "System.Windows.Forms") (use-namespace "System.Drawing")
(let () (defun clicked () (message-box "Boton presionado")))
(defun make-control (tipo &optional (x 0) (y 0) (texto "")) (let ((ctl (new tipo)) (pto (new "Point"))) (setf (property pto "X") x (property pto "Y") y (property ctl "Location") pto (property ctl "Text") texto) ctl))
(defun calculator () (let ((forma (new "Form")) (tb1 (make-control "TextBox" 0 0)) (tb2 (make-control "TextBox" 100 0)) (etiq (make-control "Label" 0 75)) (boton (make-control "Button" 0 25 "ADD"))) (setf (property forma "Text") "Lisp.Net Calculator") (invoke (property forma "Controls") "Add" boton) (invoke (property forma "Controls") "Add" tb1) (invoke (property forma "Controls") "Add" tb2) (invoke (property forma "Controls") "Add" etiq) [+Click boton (new "EventHandler" #'clicked)] [Application.Run forma] forma))
(calculator)
Error: Trying to call function RDNZL::%INVOKE-CONSTRUCTOR with NULL object #<RDNZL::CONTAINER NULL #xBC4810>.
At least two things need to be fixed in the code above:
1. You forgot to import the type "System.EventHandler" which you need. That's actually the cause for the error message - you should have checked the backtrace. Add these two lines:
(import-type "System.EventHandler") (use-namespace "System")
2. CLICKED has the wrong signature. It'll get two arguments like any event handler and you have to specify them:
(defun CLICKED (object event) ...
Of course, you can IGNORE them if you want.
I hope that'll bring you on the right track. Let me know if you still have problems.
Cheers, Edi.
------------------------------
_______________________________________________ rdnzl-devel mailing list rdnzl-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/rdnzl-devel
End of rdnzl-devel Digest, Vol 1, Issue 5 *****************************************
------------------------------
Message: 2 Date: Fri, 24 Dec 2004 21:48:51 +0100 From: Edi Weitz edi@agharta.de Subject: Re: [rdnzl-devel] RE: rdnzl-devel Digest, Vol 1, Issue 5 To: "Francisco Rivera" jfrivera56@hotmail.com Cc: rdnzl-devel@common-lisp.net Message-ID: u652rqv64.fsf@agharta.de Content-Type: text/plain; charset=us-ascii
On Fri, 24 Dec 2004 10:59:49 -0600, "Francisco Rivera" jfrivera56@hotmail.com wrote:
You forgot to import the type "System.EventHandler" which you need. That's actually the cause for the error message - you should have checked the backtrace. Add these two lines:
(import-type "System.EventHandler") (use-namespace "System")
I was using
(import-types "System" "EventHandler") (use-namespace "System")
but then the program cannot be compiled. The error was:
Warning: Returning NULL object from .NET call Error: Type with name "System.EventHandler" not found in assembly "System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". 1 (abort) Return to level 0. 2 Return to top loop level 0.
The first argument to IMPORT-TYPES is the (short) name of an assembly, not a namespace. The .NET System.EventHandler is in the System namespace but /not/ in the assembly named System.dll, it's in Mscorlib.dll, so you have to use IMPORT-TYPE, not IMPORT-TYPES.
For details as to which type is in which assembly you need to consult the .NET framework documentation which comes with Visual Studio .NET but is also available online from microsoft.com.
Cheers, Edi.
------------------------------
Message: 3 Date: Fri, 24 Dec 2004 17:27:13 -0600 From: "Francisco Rivera" jfrivera56@hotmail.com Subject: [rdnzl-devel] Crash Lispworks Personal 4.3.7 To: rdnzl-devel@common-lisp.net Message-ID: BAY1-DAV83AA684A9CDA51DEFC994DBA60@phx.gbl Content-Type: text/plain; charset="us-ascii"
Hello,
Frequently, when I select Buffer -> Compile in the Editor, the Lispworks crash with the following error:
Application has generated an exception that could not be handled
Process id=0xb2c (2860), Thread id=0xfc0 (4032)
Click OK to terminate the application.
Click CANCEL to debug the application
Is this a bug in LispWorks Personal 4.3.7 ?
Regards
Francisco Rivera
jfrivera56@hotmail.com
On Sat, 25 Dec 2004 11:22:55 -0600, "Francisco Rivera" jfrivera56@hotmail.com wrote:
Of course, below is the code. The first time, I open the code into the Editor and use Buffer --> Compile and all works fine. Later I go to the listener and write some forms like (calculador) or (descripcion-forma *f*).
Later, I make some change on the Editor. For example, in
(let () (defun clicked (&rest args) (declare (ignore args))))
the clicked function is not calling to message-box function
After make the correction I recompile the buffer and LW 4.3.7 crash. However, sometimes I only recompile the specific form, but the LW 4.3.7 crash too.
The code is only for learn to use RNDZL:
(load "C:/Program Files/Xanalys/LispWorks Personal/RDNZL-0.4.4/load.lisp")
This is the culprit - you're loading RDNZL anew each time you compile your buffer. That's not a good idea because this process re-initializes the library. I can reproduce the crash but I don't see crashes if I remove this LOAD form and load RDNZL only once at startup.
Please try and report if LW still crashes for you if you don't load RDNZL with each recompilation.
Cheers, Edi.