Skip to main content
Participating Frequently
April 16, 2008
Question

ATE problem

  • April 16, 2008
  • 3 replies
  • 1718 views
I add a tool in my plug-in named "MyTool", in its mouse drag notifier handler I dynamically create a path object. then in the mouse up notifier handler I try to add a point text at the cursor position, but It fails to create the text object. The created object is an unknown type. I don't know why? Can someboy help me? thanks!
This topic has been closed for replies.

3 replies

_duandc_Author
Participating Frequently
April 17, 2008
Ok, I fix it.
minimum99
Known Participant
March 30, 2011

So, how did you fix it? I am having the same problem!

Thanks,

Don

A. Patterson
Inspiring
March 30, 2011

Just a remark: you might want to investigate the annotator suite. If you're trying to get the effect of a peice of text or a line or something moving around on the page, the annotator suite is a good way to do that without having to manage art objects. Once you get annotators up & running, they're pretty slick.

_duandc_Author
Participating Frequently
April 16, 2008
There is no any clue. When the debugger reaches the line of "ITextRange::InsertAfter", it enters into assemble code block. I tried to use try...catch to capture the exception, but it still enters into assemble code. I only got information "memory access voilent" from Output window.

The following is the code:
AIArtHandle group = NULL;
sAIArt->GetFirstArtOfLayer(NULL, &group);

AIArtHandle art = NULL;
sAITextFrame->NewPointText(kPlaceInsideOnTop, group, kHorizontalTextOrientation, location, &art);

TextRangeRef range = NULL;
sAITextFrame->GetATETextRange(art, &range);
ITextRange cRange(range);
cRange.InsertAfter("Test");

Could you please help me? Thanks!
A. Patterson
Inspiring
April 16, 2008
When you create the art, what error number does it give back? It often (but not always) provides a clue as to why it failed to create the requested artwork.