[futurebasic] Resource Errors

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 1998 : Group Archive : Group : All Groups

From: Chris Stasny <staz@...>
Date: Wed, 29 Apr 1998 13:47:05 -0500
>I've been working on a custom resource editor using PG so I'm experiencing
>my share of crashes and screwy performance as I wend my way through the
>intricacies of working with resource files; and that's ok, I expect it.
>
Here are a few rules to follow.

1) After FN pGreplaceRes, your resource handle is no longer valid. You must
use GETRESOURCE to re-get the handle

2) Never dispose of a resource handle. (i.e. don't use DISPOSEH,
DISPOSEHANDLE, KILLPICTURE, DISPOSEMENU, etc.)

3) Except in some very rare cases, you don't need to call RELEASERESOURCE.

4) If you detach a resource it is no longer a resource, but you still have
a handle in memory to contend with.

5) If you have to lock a resource handle or make it unpurgeable, use these
steps:

     hState = FN HGETSTATE(resHndl&)
     OSErr = FN HLOCK(resHndl&)

       REM do your stuff here...

     OSErr = FN HSETSTATE(resHndl&,hState)


Yo quiero Taco Bell.

-STAZ   ~)~

--------------------------------------------------------------
STAZ Software * 4387 Leisure Time Dr * Diamondhead, MS 39525
--------------------------------------------------------------
Orders: 800-348-2623      EMail http: //www.stazsoftware.com
  Tech: 228-255-7085             FAX: 228-255-7086
--------------------------------------------------------------