All Frameworks  Class Hierarchy  This Framework  Indexes

ObjectModelerBase Global Function CATOmbPerformAfterContainerCreation


HRESULT CATOmbPerformAfterContainerCreation(CATIContainer* iContainer)
This service should be called after a container creation to declare this new container in the undo/redo mechanism. It should be called either directly after CATCreateApplicativeContainer if no initialization is done for this container, either after initializing this container. For example:

Without initialization :
   CATBaseUnknown * pAppliContainer = NULL;
   CATDocument *pDocument = ... ;
   CATIdent AppliContainerType = "....";
   CATIdent AppliContainerSuperType = "....";
   CATUnicodeString AppliContainerIdentifier = "...";
 
   HRESULT hr = ::CATCreateApplicativeContainer(&pAppliContainer,
                                                 pDocument,
                                                 AppliContainerType,
                                                 IID_CATIContainer,
                                                 AppliContainerSuperType
                                                 AppliContainerIdentifier);

   CATIContainer * pIContainer = (CATIContainer*) pAppliContainer ;

   if( SUCCEEDED(hr) && ( NULL!=pIContainer) )
      hr = ::CATOmbPerformAfterContainerCreation( pIContainer );
 
With initialization
   CATBaseUnknown * pAppliContainer = NULL;
   CATDocument *pDocument = ... ;
   CATIdent AppliContainerType = "....";
   CATIdent AppliContainerSuperType = "....";
   CATUnicodeString AppliContainerIdentifier = "...";
 
   HRESULT hr = ::CATCreateApplicativeContainer(&pAppliContainer,
                                                 pDocument,
                                                 AppliContainerType,
                                                 IID_CATIContainer,
                                                 AppliContainerSuperType
                                                 AppliContainerIdentifier);

   CATIContainer * pIContainer = (CATIContainer*) pAppliContainer ;

   if( SUCCEEDED(hr) && ( NULL!=pIContainer))
   {
      CATInit_var MyContInit(pIContainer);
      if(MyContInit != NULL_var)
      {
        MyContInit->Init(FALSE);
      }
      hr = ::CATOmbPerformAfterContainerCreation( pIContainer );
   }
 
Parameters:
iContainer
The created applicative container.
Returns:
S_OK: The created applicative container has been successfuly declared in undo/redo mechanism.
E_FAIL: the operation has failed.

This object is included in the file: CATAppliContServices.h

Copyright © 2003, Dassault Systèmes. All rights reserved.