Right now I am using the following method to get the name of my currently active layer
SPErr GetLayerName(char* name, int length)
{
SPErr error = 0;
error = PIUGetInfo(classLayer, keyName, name, &length);
if (error) goto onError;
onError:
return error;
}//GetLayerName
Then I can use
const int MAX_NAME = 256;
char** names = new char*[layerCount];
for (int i = 0; i < layerCount; ++i)
{
MakeLayerActive(i);
names[i] = new char[MAX_NAME];
GetLayerName(names[i], MAX_NAME);
}
What I need to do is get a unicode string...as of right now I am developing
the plugin on Windows, for the time being portability is not a concern (it will
be, but I just want to get it funcitoning first) so I don't mind using wchar_t.
I've tried looking for some kind of key i.e. keyUnicodeName, but can't find
anything useful down that road.
I saw another user of this forum using the following...
auto &layerInfo = globals->exportParamBlock->documentInfo->layersDescriptor;
for (int i = 0; i < layerN; ++i)
{
std::u16string utfStr = layerInfo->unicodeName;
layerInfo = layerInfo->next;
}
but it seems that his was an export plugin, while mine is an automation...
Any suggestions would be greatly appreciated
Thanks