LBuffer::LBuffer

#include "ltwrappr.h"

L_VOID LBuffer::LBuffer(L_VOID)

L_VOID LBuffer::LBuffer(dwSize)

L_VOID LBuffer::LBuffer(lpStr)

L_VOID LBuffer::LBuffer(lpData, dwSize)

L_VOID LBuffer::LBuffer(LBufferSrc)

DWORD dwSize;

/* number of bytes with which to initialize the buffer */

L_CHAR L_FAR * lpStr;

/* character string */

L_VOID L_HUGE * lpData;

/* pointer to a data buffer */

LBuffer& LBufferSrc;

/* an LBuffer object*/

Constructs the object and initializes the member variables.

Parameter

Description

dwSize

Number of bytes with which to initialize the buffer.

lpStr

Character string to be copied to the buffer.

lpData

Pointer to data buffer to be copied.

LBufferSrc

A LEAD LBuffer object to copy.

Returns

None

Comments

LBuffer::LBuffer() is a constructor for the LBuffer class.

LBuffer::LBuffer(dwSize) will initialize the member variables and allocate the specified size of memory.

LBuffer::LBuffer(lpStr) will copy the specified string to the class object's buffer.

LBuffer::LBuffer(lpData, dwSize) will copy the specified buffer to the class object's buffer. This results in two copies of the buffer.

LBuffer::LBuffer(LBufferSrc) will copy the specified class object's buffer. This results in two copies of the buffer.

The parameter LBufferSrc is passed by reference, and is a required parameter.

Required DLLs and Libraries

LTDIS

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:

LBuffer::~LBuffer, Class Members

Example

This is an example for LBuffer::LBuffer():

L_VOID TestConstructor()
{
   // this will call the default constructor and destructor when it is out of scope
   LBuffer LeadBuffer ;

   //...
}

This is an example for LBuffer::LBuffer(dwSize):

L_VOID TestConstructor (LBitmapBase& LeadBitmap)
{
   L_INT nBytesPerLine ;

   nBytesPerLine = LeadBitmap.GetBytesPerLine() ;

   LBuffer LeadBuffer ((DWORD)nBytesPerLine) ;

   //...
}

This is an example for LBuffer::LBuffer(lpStr):

L_VOID TestConstructor()
{
   LBuffer LeadBuffer(TEXT("ABCD String")) ;

   //...
}

This is an example for LBuffer::LBuffer(lpData, dwSize):

L_VOID TestConstructor(LBitmapBase& LeadBitmap) 
{
   LBuffer  LeadBuffer ;
   L_INT    nBytesPerLine ;

   L_CHAR L_FAR * pBuff ;
   
   nBytesPerLine = LeadBitmap.GetBytesPerLine() ;
   LeadBitmap.GetRow(&LeadBuffer,5) ;

   pBuff = (L_CHAR L_FAR *)LeadBuffer.Lock() ;

   LBuffer LeadConstrBuffer(pBuff,(DWORD)nBytesPerLine) ;

   LeadBuffer.Unlock() ;

   //...
}

This is an example for LBuffer::LBuffer(LBufferSrc):

L_VOID TestConstructor(LBitmapBase& LeadBitmap)
{
   LBuffer  LeadBuffer ;
   LeadBitmap.GetRow(&LeadBuffer,5) ;

   LBuffer LeadConstrBuffer(LeadBuffer) ;

   //...
}