Summary


Many objects need some support for persistence, and ATL provides an easily extensible, table-driven implementation of the IPersistStream[Init] and the IPersistPropertyBag interfaces. These implementations save and load the properties described by the class's property map entries. By overriding the appropriate methods, you can extend this persistence support for data types that property map entries do not support. The ATL implementation of IPersistStorage allows the object to be embedded into an OLE container but doesn't take advantage of many of the capabilities of the IStorage medium.

Using and extending the stream persistence support that ATL provides allows an object to offer additional functionality to its clients. For example, you've seen how to implement IPersistMemory support to your object (which MFC-based containers prefer). In addition, you can easily add marshal-by-value semantics to your class by reusing the stream persistence functionality.




ATL Internals. Working with ATL 8
ATL Internals: Working with ATL 8 (2nd Edition)
ISBN: 0321159624
EAN: 2147483647
Year: 2004
Pages: 172

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net