[comp.sys.apple] Storing print records in resource forks

JWANKERL@UTCVM.BITNET ("Josef W. Wankerl") (02/07/90)

Im trying to write an NDA text editor and would like to be able to store
the current print record in the resouce fork of the NDA.  So, when the
user reopens the NDA he/she won't have to go back to page setup and reset
the the orientation, vertical sizing, etc.  Thus far I have tried several
different methods of doing this (including adapting the sample code from
d e v e l o p), all of my attempts have resulted in the same error.  When
I try to update the resource, or (as detailed in the develop article) use
the AddResource(); call, I get a "Access Not Allowed ($4E)" error.  The file
is not locked and the resource is not protected.  Any ideas what the cause
of this could be?


 Steven W. Disbrow
 Publisher of GS+ Magazine  (Thanks to Gonzo)

/**********************************************************************\
|*      Joe "Gonzo" Wankerl       |*|  The views expressed here are   *|
|* BITNET =>  JWANKERL@UTCVM      |*|  not necessarily yours...       *|
|*                                |*|         ...but they should be.  *|
\**********************************************************************/

dlyons@Apple.COM (David A. Lyons) (02/11/90)

In article <9002071419.AA01801@apple.com> JWANKERL@UTCVM.BITNET ("Josef W. Wankerl") writes:
>Im trying to write an NDA text editor and would like to be able to store
>the current print record in the resouce fork of the NDA.  So, when the
>user reopens the NDA he/she won't have to go back to page setup and reset
>the the orientation, vertical sizing, etc.  Thus far I have tried several
>different methods of doing this (including adapting the sample code from
>d e v e l o p), all of my attempts have resulted in the same error.  When
>I try to update the resource, or (as detailed in the develop article) use
>the AddResource(); call, I get a "Access Not Allowed ($4E)" error.  The file
>is not locked and the resource is not protected.  Any ideas what the cause
>of this could be?
>
> Steven W. Disbrow

It sounds like your program is trying to add the resource to either the
Sys.Resources file or to your application's resource fork.  Have you made
an OpenResourceFile call on your document file?  If so, did you specify an
access word of $0003 (1=read + 2=write)?

(The system opens Sys.Resources with read-only permission, and StartUpTools
opens your application's resource fork with read-only permission; that's why
tring to AddResource while either of those files is the current one will get
you a $4E error.)

-- 

 --David A. Lyons, Apple Computer, Inc.      |   DAL Systems
   Apple II Developer Technical Support      |   P.O. Box 875
   America Online: Dave Lyons                |   Cupertino, CA 95015-0875
   GEnie: D.LYONS2 or DAVE.LYONS         CompuServe: 72177,3233
   Internet/BITNET:  dlyons@apple.com    UUCP:  ...!ames!apple!dlyons
   
   My opinions are my own, not Apple's.