version 2003
PA_GetBlobHandleVariable (aVariable) PA_Handle
| Parameter | Type | Description | |
| aVariable | PA_Variable | Variable to access | |
| Function result | PA_Handle | The handle to the BLOB data in the variable |
Description
The routine PA_GetBlobHandleVariable returns a handle to the BLOB data. If the variable is not a eVK_Blob variable, the routine returns 0.
To get a copy of the data, use PA_GetBlobVariable. It can be useful to only get the handle for saving memory , especially if the plug-in just want to "read-only" the BLOB content.
NOTE:
The handle belongs to the variable. Do not dispose of it.
To clear a BLOB variable, use PA_ClearVariable.
Example
Searching in a BLOB : we do not need a copy of the BLOB for this. The handle is ok.
long MySearchInBlob(PA_Variable aBlobVar, char *toFind, long toFindLength)
{
long pos = -1L;
PA_Handle h = 0L;
char *pt;
h = PA_GetBlobHandleVariable(aBlobVar);
if(h)
{
pt = PA_LockHandle(h);
pos = SuperSearchRoutine(pt, toFind, toFindLength);
PA_UnlockHandle(h);
}
return pos;
// No cleanup of h here !
}
See Also
Error Handling
PA_GetLastError keeps the last error that occurred before calling the routine.