• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

PseudoResources in Automation Plugin

New Here ,
Jan 25, 2006 Jan 25, 2006

Copy link to clipboard

Copied

My company has published a small automation plugin for Photoshop using the Adobe Photoshop 5.0 SDK. It currently works on my machine (Windows 2000) using Photoshop 7.<br /><br />I'm trying to modify the plugin so that it saves some data in the current document. The docs say that Pseudo Resources are the way to do this. Whenever I call addProc, I get no error, but countProc and getProc act as though I haven't added anything. Can anyone clue me in to what I've left out / done wrong in the following incantation?....<br /><br /><pre><br />#include <PIUtilities.h><br /><br />class PSPseudoResource_t : public PIUSuitePointer<ResourceProcs> {<br /> public:<br /> PSPseudoResource_t(SPBasicSuite* inSPBasic);<br />};<br /><br />PSPseudoResource_t::PSPseudoResource_t(SPBasicSuite* inSPBasic = NULL) :<br /> PIUSuitePointer <ResourceProcs> (<br /> inSPBasic,<br /> kPIResourceSuite,<br /> kPIResourceSuiteVersion<br /> ) {<br />}<br /><br />PSPseudoResource_t sPSPseudoResource(NULL);<br /><br /> *snip*<br /><br />SPAPI SPErr ENTRYPOINT(const char* const caller, <br /> const char* const selector, const void* const data) {<br /> const char* optionalSuiteIDs [] = {<br /> kPSBasicActionControlSuite,<br /> kPSChannelPortsSuite,<br /> kPIResourceSuite,<br /> NULL<br /> };<br /><br /> // This C++ object takes care of all dispatching.<br /> static PIUDispatch* dispatcher = new PIUDispatch (<br /> (char**) &optionalSuiteIDs,<br /> ADMAboutID,<br /> PIUAPI_None,<br /> Plugin::sExecute,<br /> PIUAPI_None,<br /> PIUAPI_None,<br /> PIUAPI_None,<br /> PIUAPI_None<br /> );<br /><br /> *snip*<br /><br /> #define MY_RES_TYPE 0x61746164<br /> int ret = 0;<br /> Handle h = NULL;<br /> char prbuff[1024] = "some_text";<br /> SPBasicSuite *sbs = &*sSPBasic;<br /> if (sbs != NULL) {<br /> h = sPSHandle->New(256);<br /> GlobalLock(h);<br /> strcpy(*h, prbuff);<br /> GlobalUnlock(h);<br /> PSPseudoResource_t new_sPSPseudoResource(sbs);<br /> sPSPseudoResource = new_sPSPseudoResource;<br /> // Returns 0<br /> ret = new_sPSPseudoResource->countProc(MY_RES_TYPE);<br /> if (ret == 0) {<br /> // Returns 0<br /> ret = new_sPSPseudoResource->addProc(MY_RES_TYPE, h);<br /> }<br /> // Returns 0<br /> ret = new_sPSPseudoResource->countProc(MY_RES_TYPE);<br /> // Returns NULL<br /> h = new_sPSPseudoResource->getProc(MY_RES_TYPE, 1);<br /> }<br /><br /> *snip*<br />}<br /></pre>
TOPICS
SDK

Views

721

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Adobe Employee ,
Jan 26, 2006 Jan 26, 2006

Copy link to clipboard

Copied

LATEST
Try making a filter plug-in and adding your resources there. Make the filter plug-in scriptable so you can call it from your automation plug-in.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines