Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!apple!sun-barr!texsun!pollux!ti-csl!m2!holland From: holland@m2.csc.ti.com (Fred Hollander) Newsgroups: comp.sys.mac.programmer Subject: Re: Purge or Revert Resource? Message-ID: <82279@ti-csl.csc.ti.com> Date: 26 Jun 89 21:20:07 GMT References: <82203@ti-csl.csc.ti.com> <689@biar.UUCP> Sender: news@ti-csl.csc.ti.com Reply-To: holland@m2.UUCP (Fred Hollander) Organization: TI Computer Science Center, Dallas Lines: 31 In article <689@biar.UUCP> trebor@biar.UUCP (Robert J Woodhead) writes: >In article <82203@ti-csl.csc.ti.com> holland@m2.csc.ti.com (Fred Hollander) writes: >>I want to revert a resource that is already loaded into memory by >>reading the resource from the resource file and discarding any >>changes. I also want to keep the same handle to the resource. Can > >So you can do something like this: > > DetachResource(H); > DisposHandle(H); > H:=GetResource('DERF',0); > >to do your reversion. I'm pretty sure that H will point to the same master >pointer after the GetResource call. IM-I has some diagrams in the Resource >Manager chapter that explain DetachResource quite well. It would be nice if it kept the same handle but, IM says (about DetachResource) that a subsequent call to GetResource will cause a new handle to be allocated. Am I misunderstanding this? Does it allocate a new block (new pointer) but, actually keep the same handle? Fred ______________________________________________________________________________ | Fred Hollander | | | Computer Science Center | "Ha ha ha ha ha ha, Ah what a day!" | | Texas Instruments, Inc. | -- Joker | | Internet: hollander@ti.com | | | Telnet: 214/995-0696 | The above statements are my own and not | | AppleLink: D1392 | representative of Texas Instruments. | ______________________________________________________________________________