L_ContainerCreate

#include "LtCon.h"

L_LTCON_API L_INT L_ContainerCreate (pContainer, hwndOwner)

Creates a container and attaches it to a user-defined window.

Parameters

pCONTAINERHANDLE pContainer

Pointer to a container handle.

L_HWND hwndOwner

Handle of the window that owns the container.

Returns

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

Comments

The container's owner window should have CS_DBLCLKS in its class style. Otherwise, some container functions will not work.

L_ContainerInit must be called before calling this function.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example shows the minimum requirements to start using some container.

L_INT ContainerCreateExample(HWND hWnd, pCONTAINERHANDLE * ppLeadContainer) 
{ 
   L_INT nRet; 
   CONTAINERMETRICS Metrics ; 
 
   /* Initialize the container handle */ 
   nRet = L_ContainerInit( ppLeadContainer ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* Create the container and attach it to its owner window */ 
   nRet = L_ContainerCreate( *ppLeadContainer, hWnd ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
   nRet = L_ContainerIsValid( *ppLeadContainer ); 
   if ( SUCCESS == nRet) /* the validity of the container handle */ 
   { 
      /* Set the container object type to rectangle */ 
      nRet = L_ContainerSetObjectType( *ppLeadContainer, CONTAINER_OBJECT_TYPE_RECT ) ; 
      if(nRet != SUCCESS) 
         return nRet; 
 
      /* Initiate the container metrics */ 
      Metrics.nSize  = sizeof ( CONTAINERMETRICS ) ; 
      Metrics.dwMask = CMF_LIMITS ;  
 
      /* Set the container limits to some value, all container inputs (after scaling) will be restricted to this range */ 
      SetRect ( &Metrics.rcLimits, 0, 0, 500, 500 ) ; 
 
      /* Set the container metrics */ 
     nRet = L_ContainerSetMetrics( *ppLeadContainer, &Metrics ) ; 
   } 
   return nRet; 
} 

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 API Help