GetWeakStorageUnitRef
TheGetWeakStorageUnitRefmethod creates a weak persistent reference to the specified storage unit.
void GetWeakStorageUnitRef ( in ODStorageUnitID embeddedSUID, out ODStorageUnitRef weakRef);
embeddedSUID- The storage-unit ID of the storage unit whose persistent reference is desired.
weakRef- The persistent reference to the storage unit specified by the
embeddedSUIDparameter.DISCUSSION
Before you call this method, you should focus this storage unit on the value where you want to store the weak persistent reference. After this method executes successfully, call theSetValuemethod to store the resulting persistent reference, returned in theweakRefoutput parameter, into the currently focused value.
- IMPORTANT
- The scope of a persistent reference is limited to the value in which it was created. If you store the persistent reference in a different value, it will almost certainly not refer to the correct storage unit.
![]()
EXCEPTIONS
kODErrIllegalNullStorageUnitInput- The
embeddedSUIDparameter is null.kODErrUnfocusedStorageUnit- This storage unit is not focused on a value.
kODErrZeroRefCount- This storage unit has a reference count of 0.
SEE ALSO
TheODStorageUnitIDtype (page 903).
TheODStorageUnitReftype (page 903).
TheODStorageUnit::GetStrongStorageUnitRefmethod (page 696).
TheODStorageUnit::IsWeakStorageUnitRefmethod (page 705).
TheODStorageUnit::SetValuemethod (page 714).
For more information on persistent references, see the chapter on storage in theOpenDoc Programmer's Guide for the MacOS .
Listing 2-43 on page 103 in OpenDoc Cookbook.
Listing 2-47 on page 110 in OpenDoc Cookbook.
"Creating Persistent References" on page 281 in OpenDoc Programmer's Guide.
"Persistent References and Cloning" on page 282 in OpenDoc Programmer's Guide.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help