LTwain::LockContainer

Summary

Gets the container information for the specified capability.

Syntax

#include "ltwrappr.h"

virtual L_INT LTwain::LockContainer(pCapability, ppContainer)

Parameters

TW_CAPABILITY * pCapability

Pointer to a TW_CAPABILITY structure from which to get the container.

void ** ppContainer

Pointer to be updated with a pointer to the container.

Returns

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

Comments

This function is used to lock the container present in the TW_CAPABILITY structure.

Once the user has the pointer to the container, the container may be changed. When the user has finished changing the container he or she must call LTwain::UnlockContainer to unlock the container. Note that this can also be accomplished using the C API GlobalLock and GlobalUnlock functions.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT LTwain__LockContainerExample(LTwain *MyClass) 
 
{ 
   L_INT          nRet; 
   TW_CAPABILITY  twCap; 
   TW_ONEVALUE *  ptwOneVal = NULL;  
 
   twCap.Cap = ICAP_XFERMECH;  
 
   twCap.ConType = TWON_DONTCARE16;  
 
   nRet = MyClass->GetCapability(&twCap, LTWAIN_CAPABILITY_GETCURRENT);  
 
   if (nRet != SUCCESS)  
 
   { 
 
      MessageBox (NULL, TEXT("Failed to get capability"), TEXT("ERROR"), MB_OK);  
 
      return nRet;  
 
   } 
 
   if (twCap.ConType == TWON_ONEVALUE) 
 
   { 
 
      nRet = MyClass->LockContainer(&twCap, (void **)&ptwOneVal);  
      if(nRet != SUCCESS) 
         return nRet; 
 
      if (ptwOneVal)  
 
      { 
 
         // Do processing 
 
         nRet = MyClass->UnlockContainer(&twCap);  
         if(nRet != SUCCESS) 
            return nRet; 
 
      } 
 
   } 
 
   return SUCCESS; 
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS TWAIN C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.