参考: http://user.qzone.qq.com/910361522/blog/1375968975
UF_MB_cb_status_t CreateNote(tag_t SelPosTag, //UF_UI_point_construct时会返回此句柄
double dArrowPos[3], //箭头放置的位置
double dLablePos[3], //文档放置位置
const CString csNote
)
{
//创建点创建引线
int status = 0;
char text[99][132+1];
char stat_msg[133];
tag_t text_aid_tag;
UF_DRF_object_t object;
//初始化项目
UF_DRF_init_object_structure(&object);
if (!status)
{
USES_CONVERSION;
//创建标签
int nLine = 0;
CString csNote2 = csNote;
while(1)
{
if (csNote2.IsEmpty())
break;
int nPos = csNote2.Find(_T('\n'));
if (nPos < 0)
{
strcpy_s(text[nLine], W2A(csNote2));
csNote2.Empty();
}
else
{
strcpy_s(text[nLine], W2A(csNote2.Left(nPos)));
csNote2 = csNote2.Right(csNote2.GetLength() - nPos - 1);
}
nLine ++;
}
object.object_tag = SelPosTag;
object.object_view_tag = NULL_TAG;
object.object_assoc_type = UF_DRF_end_point;
object.object_assoc_modifier = UF_DRF_first_end_point;
status = UF_DRF_create_label(nLine, text, dArrowPos,UF_DRF_leader_attach_object, &object, dLablePos,
&text_aid_tag);
//添加属性
UF_ATTR_value_t AtrrValue;
AtrrValue.type = UF_ATTR_string;
AtrrValue.value.string = "GeneralNote";
UF_ATTR_assign(text_aid_tag,"NoteType",AtrrValue);
}
printf("UF_DRF_create_label ");
if (status)
{
UF_get_fail_message(status, stat_msg);
printf("has ERROR %d: %s.\n", status, stat_msg);
}
else
{
printf("is successful.\n");
}
return UF_MB_CB_CONTINUE;
}