Initializing and Freeing Containers

LEADTOOLS accesses containers through the CONTAINERHANDLE structure. This structure provides a working area for the LEADTOOLS container functions. The container handle must be initialized before calling any of the container functions. This is done using the L_ContainerInit function. When the CONTAINERHANDLE structure is no longer needed, it should be freed using the L_ContainerFree function. Example code showing these calls is given below:

pCONTAINERHANDLE pLeadContainer; 
/* Initiate the container handle*/ 
L_ContainerInit(&pLeadContainer); 
/*  More Code Here */ 
if (SUCCESS == L_ContainerIsValid(pContainer))  /* check the validity of container handle */ 
{ 
   /* Free the container handle */ 
   L_ContainerFree(pContainer); 
   return SUCCESS; 
} 
else 
{ 
   return FAILURE; 
} 

A container handle is valid only after L_ContainerInit and L_ContainerCreate have been called. The validity of a container handle should be checked before calling any other container functions. This is done using L_ContainerIsValid. For more information on creating containers, refer to Creating a Container.

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

LEADTOOLS Container and Automation C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.