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, andSetResourceSizeprocedures 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
SetResLoadprocedure, specifyingFALSEfor theloadparameter, before you callGetResource. Using theSetResLoadprocedure prevents the Resource Manager from reading the entire resource into memory. Be sure to restore the normal state by callingSetResLoadagain, with theloadparameter set toTRUE, immediately after you callGetResource.
Then useReadPartialResourceto read a portion of the resource into a buffer andWritePartialResourceas 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
bufferparameter, 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 theReadPartialResourceprocedure,ReadPartialResourcereads the data on disk, not the data in memory, which is referenced through the resource's handle. Similarly,WritePartialResourcewrites data from the specified buffer, not from the data in memory, which is referenced through the resource's handle.
Subtopics
- ReadPartialResource
- WritePartialResource
- SetResourceSize