Path: utzoo!utgpu!water!watmath!clyde!rutgers!mcnc!decvax!dartvax!eleazar!earleh From: earleh@eleazar.Dartmouth.EDU (Earle R. Horton) Newsgroups: comp.sys.mac Subject: Re: Question about WDEF routines. Summary: I thought it was done like this. Message-ID: <7889@eleazar.Dartmouth.EDU> Date: 9 Jan 88 03:59:34 GMT References: <7595@sunybcs.UUCP> <7126@apple.UUCP> <3709@husc6.harvard.edu> Distribution: na Organization: Dartmouth College, Hanover, NH Lines: 29 In article <3709@husc6.harvard.edu>, olson@endor.harvard.edu (Eric K. Olson) writes: > In a recent article Larry Rosenstein writes: > >The correct thing to do is allocate a 6-byte handle and install a 68000 JMP > >instruction in the handle, which goes to the defproc. The first 2 bytes of > >such an instruction are $4EF9; the last 4 bytes should be the address of the > >defproc procedure. Then you simply install the handle in the window record. I may be missing something here, but it seems to me the best way to test a resource containing code is to compile it into a resource right off the bat. Make a resource with 68000 code in it, with entry point at the top, flags, and whatever is needed in the final resource. At run time, you load the resource using GetResource(), and there is your handle, right in the function return value. I have to admit I haven't done 'WDEF's yet, but I load many types of code this way, and some even work right the very first time! I have even been known to extract a problem function from out of a large application, place it in a little code resource of its own for easier debugging and faster recompiling, and LEAVE it there once I finally got it running. Let me know if I'm off base here, but doing it right the first time seems to me to be the least amount of work. -- ********************************************************************* *Earle R. Horton, H.B. 8000, Dartmouth College, Hanover, NH 03755 * *********************************************************************