Selection and Macro
I want to invoke a macro from within a Toolkit application.
The macro converts a selected annotation to an annotation feature.
When I select the annotation manually and then invoke the macro (mapkey) it works as intended.
When I try to do the same from within the Toolkit application it doesn't work.
The macro is executed but there is something wrong with the selection.
ProSelection AnnotationSel;
status = ProSelectionAlloc(NULL,
&((p_ListAnnFoundItem->CommonData).AnnInfo.Annotation),
&AnnotationSel); // must be freed
// Execute mapkey on selected annotation
ProLine wszMacro;
status = ProSelectionHighlight(AnnotationSel, PRO_COLOR_HIGHLITE);
ProStringToWstring(wszMacro, "%jbaf");
status = ProMacroLoad(wszMacro);
status = ProMacroExecute();
// Free selection
status = ProSelectionFree(&AnnotationSel);
The highlighting proves the annotation was selected by ProSelectionAlloc but apparently this is not seen by the macro. So I guess the selection has to be copied to a buffer or something similar in order for the mapkey to see it.
I couldn't find any information about this.
Anyone here who has done these kind of things before and who can point me to the right direction?
Thanks very much in advance.

