Page 1 of 1

Open File in filter

Posted: Mon Feb 19, 2007 5:36 pm
by darthg8r
I'm creating a plugin for adobe photoshop cs2 using the cs2 sdk. It's a filter plugin, and I'm trying to open a new file from code using a browse dialog. Every time I call sPSActionContol->Play, the plugin crashes. Is there an issue with using this object in a filter plugin? Please see the code below:

bool FileSystem::OpenDocument(std::string filename)
Auto_Desc descriptor;
Auto_Desc result(false);

sPSActionDescriptor->PutString(descriptor.get(), psapi::_strToLong("phKeyNull"), (char*)filename.c_str());

long phEventOpen = psapi::_strToLong("phEventOpen");
long phDialogSilent = psapi::_strToLong("phDialogSilent");

sPSActionControl->Play(&result, phEventOpen, descriptor.get(), phDialogSilent);

return true;