Freeing the Buffer Allocation When Extracting Text
This Tech Tip first appeared in Imaging News July 2006.
Snowbound Software’s RasterMaster imaging SDK for Windows enables you to extract text from MS Word, MS Excel, PDF, AFP, and PCL files. This text is then available to be re-purposed for publishing, archiving, or searching. To extract text in the RasterMaster Imaging SDK for Windows, you can use the IMGLOW_extract_text() function.
After you extract the text and use it, you may no longer need it and may not want to save it. In this case, you’ll want to free up the buffer allocated by the IMGLOW_extract_text() function that you used to extract the text.
This tech tip describes how to free up the buffer allocated by the call to IMGLOW_extract_text().
if ( NULL != pReturndBuffer )
{
long temp = (long)GlobalHandle((HANDLE)pReturnedBuffer);
if ( temp )
{
GlobalUnlock((HANDLE)temp);
GlobalFree((HANDLE)temp);
}
pReturnedBuffer = NULL;
}
