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

Create layer funtion

New Here ,
Jan 06, 2021 Jan 06, 2021

Copy link to clipboard

Copied

hi, I have created a function to create a new layer and want to add the selected artwork to this new layer but I am facing a problem. here is the snippet,

void create_layer(void);

static const char* layer_title = "XYZ"

void Class_name::create_layer()
{
ASErr error = kNoErr;
AILayerHandle layerHandle;

ASErr error = sAILayer->InsertLayer(NULL, kPlaceAboveAll, &layerHandle);
if (error) return;

ai::UnicodeString layerTitle(layer_title);
sAILayer->SetLayerTitle(layerHandle, layerTitle);
}

 

when I call this function from AIMenumessag, it creates the layer, but when I call this function from any other place, a "Reading access violation " error occurs. can anybody help me to fix this problem and how to add the selected artwork to the newly created layer?

 

 

 

TOPICS
SDK

Views

72

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
no replies

Have something to add?

Join the conversation
Adobe