马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
问下大家,为什么运行这个程序,就停不下来了,然后进程就死了。
代码贴这了。就是书上说的UF对象识别工具。
int CHANGE_ok_cb ( int dialog_id,
void * client_data,
UF_STYLER_item_value_type_p_t callback_data)
{
/* Make sure User Function is available. */
if ( UF_initialize() != 0)
return ( UF_UI_CB_CONTINUE_DIALOG );
/* ---- Enter your callback code here ----- */
char prtname[133];
UF_STYLER_item_value_type_t data[1];
data[0].item_attr=UF_STYLER_VALUE;
data[0].item_id=CHANGE_WIDE_S_0;
UF_STYLER_ask_value(dialog_id,&data[0]);
strcpy(prtname, data[0].value.string);
tag_t part_tag; // 部件标识
UF_PART_load_status_t load_status;
int status = UF_PART_open(prtname, &part_tag, &load_status);
status = UF_MODL_update();
status = UF_PART_save();
tag_t tObj = NULL_TAG;
int iType;
int iSubtype;
int iTypeTemp;
char sLine[MAX_LINE_SIZE]="";
UF_UI_open_listing_window();
UF_UI_write_listing_window("Tag Type Subtype Layer");
UF_UI_write_listing_window("\n--------------------");
for(int i=1;i<2;i++)
{
do
{
UF_LAYER_cycle_by_layer(i,&part_tag);
if(part_tag!=NULL_TAG)
{
iTypeTemp = iType;
UF_OBJ_ask_type_and_subtype(part_tag,&iType,&iSubtype);
if(iTypeTemp!=iType)
{
UF_UI_write_listing_window("\n");
}
sprintf(sLine,"%7d %8d\n",tObj,iSubtype);
UF_UI_write_listing_window(sLine);
}
}
while(part_tag!=NULL_TAG);
}
UF_terminate ();
/* Callback acknowledged, terminate dialog */
/* It is STRONGLY recommended that you exit your */
/* callback with UF_UI_CB_EXIT_DIALOG in a ok callback.*/
/* return ( UF_UI_CB_EXIT_DIALOG ); */
return (UF_UI_CB_EXIT_DIALOG);
} |