LBuffer::SetHandle

Summary

Initializes the class object with an allocated global buffer handle.

Syntax

#include "ltwrappr.h"

L_INT LBuffer::SetHandle(pMemHandle, dwSize=0)

Parameters

HGLOBAL * pMemHandle

Pointer to a global memory handle.

L_SIZE_T dwSize

The size of the global memory handle. Pass 0 to let the function get the size.

Returns

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

Comments

You can use this function to have the class object manipulate a buffer that you have previously allocated. This memory will be automatically freed when the class object is destroyed.

If the object already has an allocated buffer associated with it, that buffer is freed before the new handle is set.

The passed memory handle will be invalidated after this operation.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Example

L_INT LBuffer__SetHandleExample() 
{ 
   L_INT nRet; 
   LBuffer LeadBuffer ; 
   HGLOBAL hGlobal ; 
 
   hGlobal = GlobalAlloc(GMEM_MOVEABLE,1024) ; 
 
   nRet = LeadBuffer.SetHandle (&hGlobal); 
 
   return nRet; 
 
   //... 
 
} 
Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

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