Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9025199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:12:48+00:00 2026-06-16T06:12:48+00:00

Anyone met the same thing? Our plugin for Adobe AI has a custom cursor.

  • 0

Anyone met the same thing? Our plugin for Adobe AI has a custom cursor. It’s a PNG file together with an XML description, and the PNG and XML are declared in a .r REZ file. sUser->SetCursor(resID, iResourceManager); is used to set the cursor. And it can work on AI CS6, but after installing the 16.0.3 update package, there was no custom cursor, but only the default black arrow instead. I know this update makes some changes to the cursor since it supports high definition screen resolution, but the AI cursors can resize with no details missing. What can I do to add our cursor resources?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T06:12:49+00:00Added an answer on June 16, 2026 at 6:12 am

    I just dealt with this problem yesterday. The AIResourceManagerHandle appeared to be valid, but the call to sAIUser->SetCursor() returned a CANT error no matter what I tried. The cursor PNGI ID was correct, XML_ hot spot ID was correct, etc. I even tried making a variety of higher resolution PNGs for a cursor and that didn’t help either. There’s even a newer version of the SDK, but I ran a diff on it and the only changes were some unrelated comments.

    I just worked around it by using platform code for Mac, and stuck with Illustrator code for Windows. We already had a cursor class, which made it much easier (you may want to make one if you don’t have one already). It ended up looking something like this:

    class Cursor
    {
        public:
            Cursor(const int cursorID_);
            virtual ~Cursor();
            virtual void enable();
    
        private:    
            int __cursorID;
            #if defined(MAC_ENV)
                NSCursor* __cursorMac;
            #endif
    };
    
    bool getResourceData(
        const long type_,
        const int id_,
        char*& data__,
        int& size__
    ) const
    {
        static const int oneMeg = 1048576;
    
        data__ = NULL;
        size__ = 0;
    
        AIDataFilter* aidf = NULL;
        AIErr error = sAIDataFilter->NewResourceDataFilter(
            yourPluginRef,
            type_,
            id_,
            "",
            &aidf
        );
        if(error != kNoErr || !aidf)
            return false;
    
        // This is the max size to read when going in to ReadDataFilter(),
        // and the actual size read when coming out.
        size_t tmpSize = oneMeg;
    
        data__ = new char[ oneMeg ];
        error = sAIDataFilter->ReadDataFilter(aidf, data__, &tmpSize);
    
        AIErr ulError = kNoErr;
        while(aidf && ulError == kNoErr)
        {
            ulError = sAIDataFilter->UnlinkDataFilter(aidf, &aidf);
        }
    
        if(error != kNoErr)
        {
            delete[] data__;
            return false;
        }
    
        size__ = tmpSize;
        return true;
    }
    
    Cursor::Cursor(const int cursorID_)
    {
        this->__cursorID = cursorID_;
    
        #if defined(MAC_ENV)
            this->__cursorMac = nil;
    
            char* pngData = NULL;
            int pngDataSize = 0;
            if(!getResourceData('PNGI', this->__cursorID, pngData, pngDataSize))
                return;
    
            NSPoint hs = NSMakePoint(0.0, 0.0);
            char* xmlData = NULL;
            int xmlDataSize = 0;
            if(getResourceData('XML_', this->__cursorID, xmlData, xmlDataSize))
            {
                std::string xmlStr(xmlData, xmlDataSize);
                // Parse xmlStr however you prefer. If you have an XML parser, rock on.
                // Otherwise, the XML is so simple that an sscanf() call should work.
    
                delete[] xmlData;
                xmlData = NULL;
            }
    
            NSData* pngNSD = [[NSData alloc] initWithBytes:pngData length:pngDataSize];
            delete[] pngData;
            pngData = NULL;
    
            NSImage* pngNSI = [[NSImage alloc] initWithData:pngNSD];
            [pngNSD release];
            pngNSD = nil;
    
            this->__cursorMac = [[NSCursor alloc] initWithImage:pngNSI hotSpot:hs];
            [pngNSI release];
            pngNSI = nil;
        #endif
    }
    
    Cursor::~Cursor()
    {
        #if defined(MAC_ENV)
            if(this->__cursorMac)
            {
                [this->__cursorMac release];
                this->__cursorMac = nil;
            }
        #endif
    }
    
    void Cursor::enable()
    {
        #if defined(MAC_ENV)
            if(this->__cursorMac)
            {
                [this->__cursorMac set];
            }
        #elif defined(WIN_ENV)
            sAIUser->SetCursor(this->__cursorID, yourCursorRsrcMgr);
        #endif
    }
    

    Depending on how your project is configured, you may need to set your source files to be compiled as Objective-C++ and/or #import <AppKit/AppKit.h> somewhere.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone met this error? Right now i am trying to do switch from
Anyone know how to set the custom 404 Error pages that the Visual Studio
I am using Diazo in a Plone (4.2) site, and in the rules.xml file
Can anyone provide exhaustive explanation, please? I'm diving into concurrent programming and met those
Trying to get the same look for TextView and WebView content, I've met a
Anyone know how I can make a login button in Ruby on Rails for
Anyone know if there is a standard way to create a List from an
Anyone have any idea why my jQuery carousel is working fine at the bottom
Anyone know of a tutorial online that explains how to integrate alexbilbie CodeIgniter-OAuth-2.0-Server as
Anyone knows why my sql query doesn't work after using a try catch function?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.