From tarvydas at visualframeworksinc.com Sat Feb 6 21:35:54 2010 From: tarvydas at visualframeworksinc.com (Paul Tarvydas) Date: Sat, 6 Feb 2010 16:35:54 -0500 Subject: [rdnzl-devel] rdnzl vs LWW6 Message-ID: <201002061635.54207.tarvydas@visualframeworksinc.com> I wanted to have a look at rdnzl, but it crashes LWW6 when I load load.lisp (in init-rdnzl, probably inside the dll). Does anyone know how to fix this (or confirm that it works, hence, the problem is local to my machine)? thanks pt From rwiker at gmail.com Sun Feb 7 10:08:44 2010 From: rwiker at gmail.com (Raymond Wiker) Date: Sun, 7 Feb 2010 11:08:44 +0100 Subject: [rdnzl-devel] rdnzl vs LWW6 In-Reply-To: <201002061635.54207.tarvydas@visualframeworksinc.com> References: <201002061635.54207.tarvydas@visualframeworksinc.com> Message-ID: On Feb 6, 2010, at 22:35 , Paul Tarvydas wrote: > I wanted to have a look at rdnzl, but it crashes LWW6 when I load load.lisp (in init-rdnzl, probably inside the dll). > > Does anyone know how to fix this (or confirm that it works, hence, the problem is local to my machine)? I have no problems running under LWW6 under Windows XP and delivered programs under Windows server 2003. What version of Windows are you running, what version of the .NET framework, and where did you put rdnzl.dll? You'd better also make sure that you're running the latest version of rdnzl, as there has been some problems in the recent months (caused by code changes that I suggested, alas). From tarvydas at visualframeworksinc.com Sun Feb 7 16:15:26 2010 From: tarvydas at visualframeworksinc.com (Paul Tarvydas) Date: Sun, 7 Feb 2010 11:15:26 -0500 Subject: [rdnzl-devel] rdnzl vs LWW6 In-Reply-To: References: <201002061635.54207.tarvydas@visualframeworksinc.com> Message-ID: <201002071115.26544.tarvydas@visualframeworksinc.com> > On Feb 6, 2010, at 22:35 , Paul Tarvydas wrote: > > > I wanted to have a look at rdnzl, but it crashes LWW6 when I load load.lisp (in init-rdnzl, probably inside the dll). > > > > Does anyone know how to fix this (or confirm that it works, hence, the problem is local to my machine)? > > > I have no problems running under LWW6 under Windows XP and delivered programs under Windows server 2003. > > What version of Windows are you running, what version of the .NET framework, and where did you put rdnzl.dll? 32-bit Vista. .NET 3.5 framework sp1. I left rdnzl.dll in the same directory as the rdnzl code, then did (cd "../rdnzl") in the listener, then load'ed load.lisp. I also wrapped the filename with (current-pathname "RDNZL.DLL") in ffi.lisp at the register-module call. (When looking for the .NET version, I noticed that I also had the 4 beta 2 framework and client. I removed them, rebooted and tried rdnzl again, with the same results. It is safe to assume that I know nothing about .NET at this point in time). > > You'd better also make sure that you're running the latest version of rdnzl, as there has been some problems in the recent months (caused by code changes that I suggested, alas). Is the latest 0.13.2? thank you pt From rwiker at gmail.com Sun Feb 7 17:21:47 2010 From: rwiker at gmail.com (Raymond Wiker) Date: Sun, 7 Feb 2010 18:21:47 +0100 Subject: [rdnzl-devel] rdnzl vs LWW6 In-Reply-To: <201002071115.26544.tarvydas@visualframeworksinc.com> References: <201002061635.54207.tarvydas@visualframeworksinc.com> <201002071115.26544.tarvydas@visualframeworksinc.com> Message-ID: On Feb 7, 2010, at 17:15 , Paul Tarvydas wrote: >> On Feb 6, 2010, at 22:35 , Paul Tarvydas wrote: >> >>> I wanted to have a look at rdnzl, but it crashes LWW6 when I load load.lisp (in init-rdnzl, probably inside the dll). >>> >>> Does anyone know how to fix this (or confirm that it works, hence, the problem is local to my machine)? >> >> >> I have no problems running under LWW6 under Windows XP and delivered programs under Windows server 2003. >> >> What version of Windows are you running, what version of the .NET framework, and where did you put rdnzl.dll? > > 32-bit Vista. .NET 3.5 framework sp1. I left rdnzl.dll in the same directory as the rdnzl code, then did > > (cd "../rdnzl") > > in the listener, then load'ed load.lisp. I also wrapped the filename with (current-pathname "RDNZL.DLL") in ffi.lisp at the register-module call. Try moving/copying rdnzl.dll to the directory that contains the Lispworks .exe file (probably c:\Program Files\Lispworks... for "delivered" applications, you should put rdnzl.dll in the same directory as your generated .exe file. > > (When looking for the .NET version, I noticed that I also had the 4 beta 2 framework and client. I removed them, rebooted and tried rdnzl again, with the same results. It is safe to assume that I know nothing about .NET at this point in time). > >> >> You'd better also make sure that you're running the latest version of rdnzl, as there has been some problems in the recent months (caused by code changes that I suggested, alas). > > Is the latest 0.13.2? > > thank you > pt > > _______________________________________________ > rdnzl-devel mailing list > rdnzl-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/rdnzl-devel From tarvydas at visualframeworksinc.com Sun Feb 7 17:46:00 2010 From: tarvydas at visualframeworksinc.com (Paul Tarvydas) Date: Sun, 7 Feb 2010 12:46:00 -0500 Subject: [rdnzl-devel] rdnzl vs LWW6 In-Reply-To: References: <201002061635.54207.tarvydas@visualframeworksinc.com> <201002071115.26544.tarvydas@visualframeworksinc.com> Message-ID: <201002071246.00418.tarvydas@visualframeworksinc.com> > Try moving/copying rdnzl.dll to the directory that contains the Lispworks .exe file (probably c:\Program Files\Lispworks... for "delivered" applications, you should put rdnzl.dll in the same directory as your generated .exe file. That appears to have worked - it loaded without fail and I managed to run (message-box "hello") in the examples. Thank you! pt From seth at tewebs.com Sun Feb 14 23:47:43 2010 From: seth at tewebs.com (Seth Burleigh) Date: Sun, 14 Feb 2010 17:47:43 -0600 Subject: [rdnzl-devel] Fixed Assembly Resolver Example Message-ID: <1266191263.5597.9.camel@seth-laptop> When attempting to use the import assembly example from http://common-lisp.net/pipermail/rdnzl-devel/2008-February/000192.html I was having trouble. Basically, the fullname of the assembly was being passed in after I had officially loaded the assembly (it happens one time after attempting to create a new object in the assembly) and it was then trying to load something like AnAssembly, Culture=Neutral .dll So here i fixed it and you should do something like this to use it: (assembly-path! "C:/path/to/assembly/directory/" "/another/directory/") (install-assembly-resolver) I took the liberty of making install-assembly-resolver uninstall the previous assembly resolver if there were any. This is most likely the desired behavior since you dont want to install the same function each time. -------------- next part -------------- ;;EXPORT ;;(install-assembly-resolver) ;;(assembly-path! "C:/path/to/assemblies1" ...) ;;automatically uninstalls previous assembly resolver when ;;calling (install-assembly-resolver) ;;FIXES bug in which assembly-name is passed to assembly-resolver ;;in fullname, thus the function attempts to find wrong dll name. (in-package :rdnzl-user) ;;; Adds additional paths to the search-path used by the ;;; assembly-loader; so that e.g. (load-assembly x) will search for x ;;; not only in the system and application directories, but also in ;;; every directory in *additional-assembly-directories* ;;; ;;; Example: ;;; RDNZL-USER 3 > (load-assembly "AproposGui") ;;; Warning: Returning NULL object from .NET call ;;, NIL ;;; RDNZL-USER 4 > (pushnew (translate-logical-pathname #P"rdnzl:examples;") ;;; *additional-assembly-directories*) ;;; RDNZL-USER 5 > (install-assembly-resolver) ;;; # ;;; RDNZL-USER 6 > (load-assembly "AproposGui") ;;; # ;;; ;;; Alternative method of loading an assembly that doesn't lock the ;;; assembly file: ;;; byte[] asm = File.ReadAllBytes(asmPath); ;;; return Assembly.Load(asm); (defparameter *additional-assembly-directories* nil) (defun assembly-path! (&rest args) (loop for arg in args do(pushnew arg *additional-assembly-directories* :test #'equal)) *additional-assembly-directories*) (defun assembly-resolver (app-domain resolve-event-args) (declare (ignore app-domain)) (let ((assembly-name (property resolve-event-args "Name"))) (loop with parsed-name = (let ((comma-pos (position #\, assembly-name))) (if comma-pos (subseq assembly-name 0 comma-pos) assembly-name)) with filename = (make-pathname :name parsed-name :type "dll") for dir in *additional-assembly-directories* for dirpath = (if (pathnamep dir) dir (parse-namestring dir)) for path = (merge-pathnames dirpath filename) when (probe-file path) do (let* ((evidence (property (invoke "System.Reflection.Assembly" "GetExecutingAssembly") "Evidence")) (assembly (invoke "System.Reflection.Assembly" "LoadFile" (namestring path) evidence))) (return-from assembly-resolver assembly)) finally (return (make-null-object "System.Reflection.Assembly"))))) (defvar *assembly-resolve-handler* nil) (defun install-assembly-resolver (&optional (handler #'assembly-resolver)) (let ((my-domain (property "System.AppDomain" "CurrentDomain")) (assembly-resolve-delegate (new "System.ResolveEventHandler" handler))) (when *assembly-resolve-handler* (uninstall-assembly-resolve-handler *assembly-resolve-handler*) (setf *assembly-resolve-delegate* assembly-resolve-delegate)) (prog1 assembly-resolve-delegate (invoke my-domain "add_AssemblyResolve" assembly-resolve-delegate)))) (defun uninstall-assembly-resolve-handler (handler) (invoke (property "System.AppDomain" "CurrentDomain") "remove_AssemblyResolve" handler) (setf *assembly-resolve-handler* nil))