[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resource Manager - please help!



In article <1993May16.191255.28312@ifi.unizh.ch> gudat henrik,
gudat@avalon.physik.unizh.ch writes:
> I have a question regarding the Resource Manager:
>  
> Imagine you have several sys16 applications in memory (using TM, but I
> guess it works the same way with SI!). They all have a rVersion
> resource. Now I want to load that resource (resp. ask the res manager
> for a handle): first I call GetCurResourceApp (=>MyID), then
> SetCurResourceApp(TheOtherID), do a LoadResource($8029_1), and then
> restore the system with SetCurResource(MyID).
>  
> I have done this, and the funny part of this story is that SOME
> applications work with this method, others do NOT - they cause a $1308
> ("application has not started up Resource Manager") during the first
> SetCurResourceApp!!! This problem developed with the programs Teach,
> Platinum Paint and others. (Both actually have a rVersion resource.)
> It did work always with the Finder and Symbolix (HOOORAY! :):). Other
> programs I'm using do not have a rVersion resource...so...
>  
> I really don't understand this. At least Platinum and Teach depend on
> resources and certainly start up the resource manager.

This is happening because Teach starts up the Resource Manager with a
memory ID of $11xx, instead of $10xx.  (If you type \res in Nifty List,
you'll see that this is true.  Strange, but true.)

You can't be sure a random application has started the Resource Manager
with a certain memory ID, or even that the app starts up the Resource
Manager at all (even if it has an rVersion resource).

Here's an idea:  Since few applications open their resource forks for
writing, you can (re)open its resource fork read-only in your own
resource search path (no need to mess with CurResourceApp).  If you take
this approach, you'll probably want to set the no-preload bit on
OpenResourceFile.

David A. Lyons, Apple Computer, Inc.      |   DAL Systems
Apple II System Software Engineer         |   P.O. Box 875
Internet:dlyons@apple.com                 |   Cupertino, CA 95015-0875

My opinions are my own, not Apple's.