Important: The information in this document is obsolete and should not be used for new development.
Reading and Writing Partial Resources
You can use theReadPartialResource
,WritePartialResource
, andSetResourceSize
procedures to work with a portion of a large resource that may not otherwise fit in memory.When using partial resource routines, you should call the
SetResLoad
procedure, specifyingFALSE
for theload
parameter, before you callGetResource
. Using theSetResLoad
procedure prevents the Resource Manager from reading the entire resource into memory. Be sure to restore the normal state by callingSetResLoad
again, with theload
parameter set toTRUE
, immediately after you callGetResource
.
Then useReadPartialResource
to read a portion of the resource into a buffer andWritePartialResource
as needed to write a portion of the resource from a buffer
to disk.Note that the partial resources routines work with the data in the memory pointed to by the
buffer
parameter, not the memory referenced through the resource's handle. Therefore, you may experience problems if you have a copy of a resource in memory when you are using the partial resource routines. If you have modified the copy in memory and then access the resource on disk using theReadPartialResource
procedure,ReadPartialResource
reads the data on disk, not the data in memory, which is referenced through the resource's handle. Similarly,WritePartialResource
writes data from the specified buffer, not from the data in memory, which is referenced through the resource's handle.
Subtopics
- ReadPartialResource
- WritePartialResource
- SetResourceSize