version 2003
PA_ReturnBlobHandle (params; hblob)
Parameter | Type | Description | |
params | PA_PluginParameters | Parameters received in PluginMain | |
hblob | PA_Handle | Handle of the BLOB to be returned |
Description
The routine PA_ReturnBlobHandle sets the returned value of a plug-in function to hblob,received by the calling 4D method.
This is useful in memory optimization. PA_ReturnBlob returns a copy of the original BLOB. This can be a problem with large BLOBs. With PA_ReturnBlobHandle, you simply return a handle to the BLOB.
WARNING
The handle belongs to 4D after the call, never dispose of it.
See Create a new plug-in for a description of returned values accessors.
Example
Same example as PA_ReturnBlob, but use PA_ReturnBlobHandle here.
void ReturnBasicBlob(PluginParameters params) { PA_Handle blob; char *ptr; blob = PA_NewHandle(1024); if(blob) { ptr = PA_LockHandle(blob); for(i = 0; i < 1024;i++) *ptr++ = (char)1; PA_UnlockHandle(blob); // Return the blob PA_ReturnBlobHandle(params, blob); // OK. The blob belongs to 4D. We do not call PA_DisposeHandle here. } }
See Also
Create a new plugin, PA_ReturnBlob.
Error Handling
None.