LAutomation::AddContainer

#include "ltwrappr.h"

L_INT LAutomation::AddContainer(pLContainer , pModeData)

Adds a new container to the automation list of containers.

Parameters

LContainer * pLContainer

Pointer to a container object.

L_VOID * pModeData

Pointer to a structure that contains information about the mode used to create the specified automation handle. If the automation handle was created using AUTOMATION_MODE_VECTOR, pModeData should point to a VECTORHANDLE structure. If the automation handle was created using AUTOMATION_MODE_PAINT, pModeData should point to a CONTAINERPAINTDATA structure.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

For an SDI application, usually a single container for the current SDI window will be added. For an MDI application, usually a new container will be added every time a new MDI child window is created.

The newly added container will become the active automation container.

Adding a new container will provide all automation functionality to the window that owns the newly added container.

To remove a container from the automation list of containers, call LAutomation::RemoveContainer.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example * Creates a container

  • Associates it with a LVectorWindow object

  • Adds the container to an automation object

  • Sets some container properties

    L_INT LAutomation_AddContainerExample(HWND hWnd, LVectorWindow &VectorWindow, LAutomation &Automation, LContainer &Container) 
    { 
       L_INT nRet; 
     
       CONTAINERMETRICS ContainerMetrics; 
     
       VectorWindow.SetWndHandle (hWnd);  
     
       VectorWindow.AttachToWindow(hWnd); 
     
       nRet = Container.Initialize(); 
       if(nRet != SUCCESS) 
          return nRet; 
     
       nRet = Container.Create(hWnd); 
       if(nRet != SUCCESS) 
          return nRet; 
     
       nRet = Automation.AddContainer(&Container, VectorWindow.GetHandle () ); 
       if(nRet != SUCCESS) 
          return nRet; 
     
       nRet = Automation.SetActiveContainer(&Container); 
       if(nRet != SUCCESS) 
          return nRet; 
     
       ContainerMetrics.dwMask =  
     
          CMF_BORDERCOLOR |  
     
          CMF_HANDLECOLOR |  
     
          CMF_HANDLEHEIGHT |  
     
          CMF_HANDLEWIDTH |  
     
          CMF_ENABLEHANDLES; 
     
     
       ContainerMetrics.crBorder = RGB(255,0,0); 
     
       ContainerMetrics.crHandle = RGB(0,255,0); 
     
       ContainerMetrics.nHandleHeight = 8; 
     
       ContainerMetrics.nHandleWidth = 8; 
     
       ContainerMetrics.fEnableHandles = TRUE; 
     
       nRet = Container.SetMetrics(&ContainerMetrics); 
       if(nRet != SUCCESS) 
          return nRet; 
     
       return SUCCESS; 
    } 

Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Container and Automation C++ Class Library Help