Developing filter plug-in: having trouble storing image buffer in the registry

Hi guys, I'm new to plug-in development and having a bit of trouble with storing information to the photoshop registry. My plug-in has two buttons, "capture" and "apply". When the capture button is pressed, the filter needs to grab whatever image data has focus. Then the user would give a different image focus, run the filter again and press "apply", transfering information from the captured image to the new image. The problem is that filter memory is wiped between executions so I need to save the captured image to the registry (I think anyway, please let me know if there's anything easier I could be doing).
Anyway, I'm modifying the dissolve example from the SDK, I'm in DissolveRegistry.cpp
In dissolve.h I define an image buffer and it's length
Ptr transferBuffer;
int32 transferBufferLength;
Then in DissolveRegistry.cpp I try to write and read this information as follows
//WRITE BUFFER
err = descriptorProcs->PutInteger(descriptor, keyTransferLength, gData->transferBufferLength);
if (err) goto returnError;
err = descriptorProcs->PutData(descriptor, KeyTransfer, gData->transferBufferLength, gData->transferBuffer);
if (err) goto returnError;
//READ BUFFER
err = descriptorProcs->GetInteger(descriptor, keyTransferLength, &gData->transferBufferLength);
if (err) goto returnError;
err = descriptorProcs->GetData(descriptor, KeyTransfer, gData->transferBuffer);
if (err) goto returnError;
It seems to write okay (by okay I mean it doesn't actually throw an error), and the buffer length seems to be working okay (unless I'm missunderstanding my debugger). When I try to read the buffer though, I get a "bad pointer" error. I guess I don't understand how the PutData function works, does it not set the pointer to the buffer I saved? Does anyone have any example code for how to do this correctly?
Sorry if this code is terrible. I have almost no experience with this sort of thing and I can't find any documentation. Any help would be much appreciated!
Kindest Regards,
Eric

You need to create space to copy the data before the GetData call.
Something like
gData->transferBuffer = new char[gData->transferBufferLength];

Similar Messages

Maybe you are looking for

  • One apple ID could install how many computer?

    If i purchase new mountian, Could I install 4 computers - all belong to same family.

  • HD needs to be repaired

    Hi I just downloaded the latest version of Onyx (Leopard version, I am running OS X 10.5.1), and I ran the verify start up volume. It said it needed to be repaired, so I ran OS X's disk utility and verified the startup volume. I got the following mes

  • Error while integrating Struts1.2.9 with Hibernate on WEBLOGIC 8.1 sp2

    Hi, I am trying to use Hibernate in my application but while integration struts with Hibernate i m getting the following error <Error> <HTTP> <BEA-101216> <Servlet: "action" fail ed to preload on startup in Web application: "DefaultWebApp". javax.ser

  • What happened to third party apps for OSX 10.5 ?

    A case most curious ! I cant seem to locate any third party apps for OSX 10.5 when clicking on the third party apps link on the apple downloads page ! The link doesnt seem to work any longer - any idea as to why ? Thank you in advance

  • RHEL-4.4 Advanced Server - ASM or ASMLib?

    Hi, I am currently running RHEL-4 AS (Nahant) Update 4 for Linux x86 and going to make first-time, clean Oracle 10g R2 (10.2.0.1.0) installation. I have 4 physical SATA disks (120 GB each) attached to Promise SATA TX4 Controller, each disk to its own