10 Replies Latest reply: Oct 2, 2012 8:41 AM by Gary Staas2 RSS

    kSPSuiteNotFoundError when Acquiring kAIImageOptSuite

    Gary Staas2

      Why do I get a kSPSuiteNotFoundError when calling AcquireSuite for kAIImageOptSuite

        • 1. Re: kSPSuiteNotFoundError when Acquiring kAIImageOptSuite
          A. Patterson Community Member

          Two possible reasons I can think of: (a) the version of the suite you're asking for doesn't exist for that version of Illustrator or (b) the plugin in which the ImageOptSuite resides hasn't been loaded yet.

           

          Double-check (a) and if that all looks good, try loading the AIImageOptSuite at a later time, see if that helps.

          • 2. Re: kSPSuiteNotFoundError when Acquiring kAIImageOptSuite
            Gary Staas2 Community Member

            Thanks. I  use kAIImageOptSuiteVersion for the suite version, which is the latest for AI CS 5, which is what I am using.

             

            I attempt to acquire the suite with this code:

             

            error = sSPBasic->AcquireSuite(kAIImageOptSuite, kAIImageOptSuiteVersion,

                                                (const void **)sAIImage);

             

            I seem to get an exception. I'm not sure what's happening here. I copied this code from the Marked Objects sample.

            Gary

            • 3. Re: kSPSuiteNotFoundError when Acquiring kAIImageOptSuite
              A. Patterson Community Member

              That all looks pretty good (assuming sAIImage is the right type of course). What's the error value? I assume it's kSPSuiteNotFoundError, but just in case its something we should double-check that.

               

              When are you acquiring the suite? In response to what selector/caller?

              • 4. Re: kSPSuiteNotFoundError when Acquiring kAIImageOptSuite
                Gary Staas2 Community Member

                Here's the type:

                 

                AIImageOptSuite* sAIImage = NULL;

                 

                I originally was acquiring the suite when the Marked Objects sample was acquiring it, near the beginning of the plug-in load. When it was attempting to acquire the suite then, the error was

                kSPSuiteNotFoundError'S!Fd'.

                 

                I changed it to try to acquire the suite after AI has fully launched in response to a menu item selection. The line with AcquireSuite then gets an exception. The pointer sSPBasic is the correct value, so I'm puzzled.

                Gary

                • 5. Re: kSPSuiteNotFoundError when Acquiring kAIImageOptSuite
                  A. Patterson Community Member

                  I feel dumb -- you mentioned the error type in the topic title but I guess two replies in I forgot

                   

                  Hmmm. the same line of code gets an exception? That's bizarre. I just realized we're not actually using that suite. I just added it in and it works just fine, but I'm currently using CS6, so that's not much help.

                   

                  This will sound dumb, but instead of using the sSPBasic in your later-load attempt, can you use the one in the data block of whatever message is being received? I.e. something like:

                   

                  // just example, I don't know what the actually call-in looks like in your code

                  void HandleNotifiers(AINotifierMessage* m)

                  {

                    m->d->basic->AcquireSuite(kAIImageOptSuite, kAIImageOptSuiteVersion, (const void **)sAIImage);

                  }

                   

                  I just wonder if sSPBasic has been released, but not zeroed. If its definitely not that, this won't help.

                  • 6. Re: kSPSuiteNotFoundError when Acquiring kAIImageOptSuite
                    Gary Staas2 Community Member

                    Yes, it sounds like sSPBasic has been released, so I get an exception when I try to use it.

                     

                    But the basic question is why I am not able to acquire the suite? I wondered if there was some plug-in providing this that was not enabled or present. I see that there are plug-ins under Adobe Illustrator CS5.1\Support Files\Required\Plug-ins. Placing these plug-ins under the regular Plug-ins folder doesn't help though.

                     

                    I'm really puzzled, because this suite was available in earlier versions; I see API in it mentioned in other forum articles. I'm trying to export a file to JPEG and PNG, and that ability is in Illustrator from menu items. So the capability is there. Why can't I get to it?

                     

                    Any other throughts?

                    Thanks,

                    Gary

                    • 7. Re: kSPSuiteNotFoundError when Acquiring kAIImageOptSuite
                      A. Patterson Community Member

                      The trouble is plugin loading order I think. We've found that when our plugin is loaded, there are still other plugins yet to load, including those installed by Adobe as 'built in' (at least, that's how a user would view it). If they provide a suite and haven't been loaded yet, then naturally you'll get 'suite not found'.

                       

                      Theoretically, you sould be able to specify what suites you require in your PIPL, and the SuiteP system is supposed to figure out an order so this kind of thing doesn't happen. But I experimented with this years ago and its clear that while that stuff is in there, it is simply not part of the Illustrator system. As a result, we just gave up and when we encountered this problem, we found an appropriate later time to load these suites. Another three suites we found that had this problem are kAIPathConstructionSuite, kAIPaintStyleSuite & kAIBeautifulStrokesSuite. I think the PaintStyleSuite worked on PC but not Mac or something like that. We load these suites when the kAIApplicationStartedNotifier is received.

                      • 8. Re: kSPSuiteNotFoundError when Acquiring kAIImageOptSuite
                        Gary Staas2 Community Member

                        After a break, I'm trying to do this again. I found the problem with the line

                         

                        error = sSPBasic->AcquireSuite(kAIImageOptSuite, kAIImageOptSuiteVersion,

                                                            (const void **)sAIImage);

                         

                        It's supposed to use &sAIImage:

                         

                        error = sSPBasic->AcquireSuite(kAIImageOptSuite, kAIImageOptSuiteVersion,

                                                            (const void **)&sAIImage);

                         

                        So, the plug-in doesn't crash any more. However, I still get the same error code kSPSuiteNotFoundError indicating that the suite could not be found. I tried the suite version kAIImageOptSuiteVersion1 with exactly the same results. The suite for kAIImageOptSuite does appear to be the suite I need to use conversion functions, as in sAIImage->AsJPEG.

                         

                        I uninstalled and reinstalled AI with no improvement. I thought maybe I needed the file Adobe Illustrator CS5.1\Support Files\Required\Plug-ins\Rasterize.aip, so I put it in the plug-ins folder. That made no difference either. AI just can't find this suite for some reason.

                         

                        Any further ideas?

                        Thanks,

                        Gary

                        • 9. Re: kSPSuiteNotFoundError when Acquiring kAIImageOptSuite
                          A. Patterson Community Member

                          Did you ever try attempting the load later on? I.e. not during your plugin's load?

                          • 10. Re: kSPSuiteNotFoundError when Acquiring kAIImageOptSuite
                            Gary Staas2 Community Member

                            Oh yes, I forgot to mention that I tried downloading the suite during a function that is called in response to selecting a menu item, after all intialization had taken place. The suite was still not found.

                            Thanks,

                            Gary