The following class provides support for object safety:
ATL Class Overview
Related Articles ATL Tutorial