IPersistentChunk::getChunk
tresult PLUGIN_API getChunk (char* chunk, long* size)
Called by the host application to create a preset from the current Plug-In state.
Remarks:
This method is called twice! At first the chunk parameter is NULL, on return size
has to be set to the maximum size required for storing the Plug-In state. The host then can allocate
the required memory amount and calls IPersistentChunk::getChunk again to actually save the
state to chunk (see following host example).
IPersistentChunk* plug; // a valid Plug-In reference
long size;
if(plug->getChunk (0, &size) == kResultOk && size > 0)
{
char* chunk = new char[size];
plug->getChunk (chunk, &size);
...
delete [] chunk;
}
Last Modified: