[comp.sys.apple2] Resources in NDA's

dlyons@Apple.COM (David A. Lyons) (06/27/90)

In article <7881@ur-cc.UUCP> mek4_ltd@uhura.cc.rochester.edu (Mark Kern) writes:
>My NDA uses resources to define its window and the controls in
>the window. When I use this NDA under an application that uses resources,
>menu items in the application can be confused with menu items (pop-up
>items) in my NDA. As far as I can tell, I've done everything by the book
>(or rather books and lots of source code examples). When I open my NDA, I
>open up it's resource fork and make two calls...one to open the window,
>and another to draw the controls (the controls are not tied to the
>window).

You need to make a ResourceStartUp call with your NDA's user ID *before*
you open your resource fork--otherwise you're adding your own resource
fork to the current *application's* resource search path.

You should also use GetCurResourceApp and SetCurResourceApp around the
interesting part of your DA's Open function (I haven't checked whether
this is strictly necessary, but it's not clear that it's redundant, and
it's certainly safe).

BTW, a Technical Note (by yours truly) *is* on the way to address the
how-do-I-use-resources-from-an-NDA question.

On your other question--Yes, MMStartUp is a correct way to find your
own user ID.  (You shouldn't be calling MMShutDown in your NDA, though.)
-- 
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.