OPENC函数 UF_CAM UF_NCGROUP (UF_CAM_opt_ask_types UF_CAM_opt_ask_subtypes UF_NCPROG_create UF_NCGROUP_accept_member)
1 UF_initialize(); 2 3 //ask_setup 4 tag_t setup_tag=NULL_TAG; 5 //ask_program_root 6 tag_t programmer_root=NULL_TAG; 7 //opt_ask_types and subtypes 8 int ty_count=0; 9 int sub_count=0; 10 const char **type_nemas=NULL; 11 const char **subtype_nemas=NULL; 12 //programmer_create 13 tag_t new_programmer_tag=NULL_TAG; 14 //can_accept_member 15 logical answer=false; 16 char reason[UF_NCGROUP_MAX_REASON_LEN+1]; 17 18 char msg[256],msg1[256]; 19 //根 20 UF_SETUP_ask_setup(&setup_tag); 21 //程序试图 22 UF_SETUP_ask_program_root(setup_tag,&programmer_root); 23 //模板名称和子名称 24 UF_CAM_opt_ask_types(&ty_count,&type_nemas); 25 UF_UI_open_listing_window(); 26 for (int i=0;i<ty_count;i++) 27 { 28 sprintf_s(msg, "类型:%s\n",type_nemas[i]); 29 UF_UI_write_listing_window(msg); 30 } 31 UF_CAM_opt_ask_subtypes(type_nemas[3],UF_CAM_OPT_STYPE_CLS_PROG,&sub_count,&subtype_nemas); 32 for (int j=0;j<sub_count;j++) 33 { 34 sprintf_s(msg1, "子类型:%s\n",subtype_nemas[j]); 35 UF_UI_write_listing_window(msg1); 36 } 37 /* 38 1.注意 此处 UF_CAM_opt_ask_types 和 UF_CAM_opt_ask_subtypes是访问 39 模板中的程序组然后去创建程序组 40 2.如果编程模板中你没有去设置程序程序组建议你直接命名这样比较好 41 */ 42 //创建程序组 43 UF_NCPROG_create((char *)type_nemas[3],(char *)subtype_nemas[0],&new_programmer_tag);//此处type_nemas[3]为当前模板类型的第四个类型 44 //能否选择接受他(╯﹏╰) 45 UF_NCGROUP_can_accept_member(programmer_root,new_programmer_tag,&answer,reason); 46 if (answer==true) 47 { 48 //当然是选择接受他啊(╯﹏╰) 49 UF_NCGROUP_accept_member(programmer_root,new_programmer_tag); 50 UF_UI_ONT_refresh(); 51 } 52 else 53 { 54 uc1601("不能接受!",1); 55 } 56 //释放字符串数组的内存 57 UF_free_string_array(sub_count,(char **)subtype_nemas); 58 UF_free_string_array(ty_count,(char **)type_nemas); 59 60 UF_terminate();
Life's is not that binary