I have the following problem:
I need to do some things to the currently selected art objects when the user clicks a button in my HTML extension.
For that I pass an event from the extension to the C++ plugin. This event is properly caught and calls a function which does the following:
|AIArtHandle ** selectedArt = nil;|
|result = sAIMatchingArt->GetSelectedArt(&selectedArt, &selectedCount);|
This function always fails - the selectedCount is always zero and result is an error code "?COD" which I cannot find anywhere in the documentation.
However, when calling this function directly from the C++ plugin (like through a menu item) it works properly and yields the current selection.
I am using Illustrator CC 2015.3 on Windows.
Sounds like you need to push the AppContext to make suite calls work. '?COD' is actually 'DOC?' which would be the case if you don't have a context.
I do this in my extension controller functions before calling suite functions, as per the sample code:
That did indeed solve my problem, thank you very much!