On Fri, 01 Feb 2008 18:19:29 -0500, Michael Mills mikaelmills@gmail.com wrote:
I'm having a problem with RDNZL using ECL. I'm using a send a (lisp) string to the simple .net gui through a callback. It most works, but the string gets mangled when it goes into .net.
The .net consumer looks like this: EditBox_Results.Text = cpc(TextBox_Filename.Text); where EditBox is a rich textbox, and cpc is a "public delegate System.String callback(string input);" which is set in the constructor. The list invocation looks like this: [Application.Run (new "CPC_interface" (new "callback" #'(lambda (filename) (pretty-print-cpc filename t)) ))] where CPC_interface is my .net gui, and pretty-print-cpc is defined as: (defun pretty-print-CPC (filename &optional (echo nil)) (handler-case (let ( (result (calculate-page-coverage filename)) ) (format echo "Cyan: ~$ %~%Magenta: ~$ %~%Yellow: ~$ %~%Black: ~$ %~%Total Byte Count: ~a" (* 100 (car result)) (* 100 (cadr result)) (* 100 (caddr result)) (* 100 (cadddr result)) (car (cddddr result)) )) (file-error () "File Not Found") ))
for the test files I run it on, the result of pretty-print-cpc is: Cyan: 37.50 % Magenta: 37.50 % Yellow: 37.50 % Black: 12.50 % Total Byte Count: 32
however the .net gui is displaying that as: ???????
As I mentioned before, I'm using ECL is my lisp. I'm compiling the .net part using Visual Studio 2005 C# targeting version 2 of the .net framework.
I don't have ECL myself, but here are some things you could check to isolate the problem:
1. Can you run the Apropos example that comes with RDNZL without problems? It uses a delegate with the same signature.
2. Does your application work if you use LispWorks instead of ECL?
And which version of ECL are you using, BTW?
Cheers, Edi.