Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS TWAIN C++ Class Library Help

LTwain::LockContainer

Show in webframe

#include "ltwrappr.h"

virtual L_INT LTwain::LockContainer(pCapability, ppContainer)

TW_CAPABILITY * pCapability;

/* pointer to a structure */

void ** ppContainer;

/* pointer to a pointer to a structure */

Gets the container information for the specified capability.

Parameter

Description

pCapability

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

ppContainer

Pointer to be updated with a pointer to the container.

Returns

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 DLL GlobalLock and GlobalUnlock functions.

Required DLLs and Libraries

LTTWN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LTwain::UnlockContainer.

Topics:

How to Work with the Containers

 

TWAIN Functionality: Container Functions.

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;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.