NOTE: This Technical Note has been retired. Please see the Technical Notes page for current documentation.

Technical Note TB32
ChangedResource: Too much of a good thing

CONTENTS

[Apr 01 1988]






Introduction

The toolbox trap ChangedResource is used to inform the Resource Manager that the contents of a resource have changed and should be written to disk. The actual write occurs on the next call to WriteResource (for the specific resource) or UpdateResFile (for the resource file containing the specified resource). When called, ChangedResource reserves enough disk space to contain the changed resource. A little-known "feature" of ChangedResource is that it reserves disk space every time it is called. Thus if you call ChangedResource ten times on a large resource before the resource is actually written out, you may unexpectedly run out of disk space since ten times the amount of disk space actually needed will be reserved.

If your program frequently changes the contents of resources, especially large ones, then you should call WriteResource or UpdateResFile immediately after calling ChangedResource. Once the resource is actually written, the file's EOF will be set correctly, and the first subsequent call to ChangedResource will work correctly.

Back to top

References

The Resource Manager

Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (44K).

Download



Developer Documentation | Technical Q&As | Development Kits | Sample Code