Working with archives

When your program has an archived menu, your presenter class needs to retrieve the already-built menu from your program's archive instead of constructing the menu one item at a time, as discussed earlier in this step.

To retrieve the menu from the archive:

  1. Open the archive for your program.
    The TArchive class provides a static function, CopyArchiveForSharedLibrary, that returns the archive associated with the shared library in which the calling function is defined. For example, if call this function from TTilesPresenter::HandleActivateMenu and it returns the archive TilesTutorialLib.archive.




  1. Copy the menu object from the archive.
    To copy a specific object from an archive, you create a TArchiveEnvelope for that type of object (for example, a TMenu) and copy the object into the envelope. You use a text key to identify the specific object you want to copy. For example, the cpConstructor tool archives menu objects using the text key "Menu".
For general information on archives, see the section "Archiving localized presentations" in Chapter 10, "Locales," of Text, Native Language Support, and Time Media. For more information on how you can manipulate archives with the cpConstructor tool, see cpConstructor GUI Development Tool.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker