这是UFUN帮助的官方例子

 /******************************************************************************
Copyright (c) 1999 Unigraphics Solutions, Inc.
Unpublished - All Rights Reserved *******************************************************************************/
/* The following example demonstrates how to invoke
UF_UI_open_part. */
/* ***** Include Files ***** */
#include <stdio.h>
#include <string.h>
#include <uf.h>
#include <uf_part.h>
#include <uf_ui.h>
/* ***** Local Prototype ***** */
static logical my_error_handler
(
UF_UI_err_data_p_t error_fn_data,
char *file_name,
int error,
UF_PART_load_status_t *error_status,
logical *skip_error_disp
);
/* ***** Entry Point ***** */
/*ARGSUSED*/
extern void ufusr(char *param, int *ret_code, int len)
{
/*
*********************
variable declarations
*********************
*/
int response;
tag_t part_tag = NULL_TAG;
char file_name[MAX_FSPEC_SIZE + ] = "flange.prt";
const char *message = "part open error";
logical use_display_file = FALSE;
UF_PART_load_status_t part_status;
UF_UI_err_t error_handler; /*
************************************************
initialize the 'struct' as an open part 'struct'
and assign the local function prototyped above
as the callback
************************************************
*/
error_handler.type = UF_UI_open_part_fun;
error_handler.fun.open = my_error_handler;
/*
************************************************
assign the client data and its size
Note: this is an arbitrary usage of the client
data. A better use might be to pass the name of
a UIStyler dialog which would then be invoked in
the callback
************************************************
*/
error_handler.fun_data.size = strlen(message) + ;
error_handler.fun_data.data = message;
/*
*************************************************
call the function, free any allocated memory
*************************************************
*/
UF_initialize();
UF_UI_open_part(&error_handler, file_name,
&use_display_file,
&part_tag, &response, &part_status);
if (part_status.statuses != NULL)
{
UF_free(part_status.statuses);
}
if (part_status.file_names != NULL)
{
UF_free_string_array(part_status.n_parts,
part_status.file_names);
}
UF_terminate();
}
/* ***** local function to be invoked as a callback ***** */
static logical my_error_handler
(
UF_UI_err_data_p_t error_fn_data,
char *file_name,
int error,
UF_PART_load_status_t *error_status,
logical *skip_error_disp
)
{
/*
***************************************************
this function trivially just prints the client data
that it receives as well as the file name and the
error
As mentioned above, a better usage of the client
data would be to pass through the name of a
UIStyler dialog to display. Such a use might
resemble the following:
UF_STYLER_create_dialog (
( char * ) error_fn_data->data ,
callbacks ,
n_callbacks ,
NULL ,
&response );
***************************************************
*/
fprintf(stderr, "my_error_handler called with:\n"
" error_fn_data->size = %d\n"
" error_fn_data->data = %s\n"
" file_name = %s\n"
" error = %d\n",
error_fn_data->size,
(const char *)error_fn_data->data,
file_name,
error
);
/* **************************************************
instruct NX to display its error dialog and to
continue looping within the dialog until a part
is opened
**************************************************
*/
*skip_error_disp = TRUE;
return TRUE;
}

NX二次开发-打开part对话框UF_UI_open_part的更多相关文章

  1. NX二次开发-打开文件夹,并同时选中指定文件

    NX9+VS2012 #include <uf.h> #include <uf_ui.h> #include <uf_part.h> #include <at ...

  2. NX二次开发-UFUN特征选择对话框UF_UI_select_feature

    #include <uf.h> #include <uf_ui.h> UF_initialize(); //特征选择对话框 char sMessage[] = "特征 ...

  3. NX二次开发-打开弹出当前part所在的文件夹

    #include <uf.h> #include <uf_part.h> #include <atlstr.h> #include <iostream> ...

  4. NX二次开发-使用MFC对话框不能用UF_UI_select等函数解决方法

    VC/MFC调用UG Dialog要进入加锁状态 加锁 UF_UI_lock_ug_access ( UF_UI_FROM_CUSTOM ); 此处为UF_UI_select的函数 解锁 UF_UI_ ...

  5. NX二次开发-uc1600字符串对话框

    NX9+VS2012 #include <uf.h> #include <uf_ui.h> UF_initialize(); char* cue = "输入框&quo ...

  6. NX二次开发-基于MFC界面对话框与NX交互的开发

    打开VS2013 点击新建,选择MFC DLL 点击确定 点下一步 什么都不改,直接点完成 进来之后先编译一下,看是否编译成功 打开项目属性,更改这几处 $(UGII_BASE_DIR)\ugopen ...

  7. NX二次开发-BlockUI对话框嵌套MFC对话框制作进度条

    半年前在一些QQ群看到有大神NX二次开发做出了进度条,那个时候我还不会弄,也不知道怎么弄得,后来断断续续得研究了一下,直到今天我把它做出来了.内心还是很喜悦的!回想自己这两年当初从没公司肯给我做NX二 ...

  8. NX二次开发-基于MFC界面的NX对Excel读写操作(OLE方式(COM组件))

    NX二次开发API里没有对EXCAL读写操作的相关函数,市面上有很多种方法去实现,比如UFUN调KF,ODBC,OLE(COM组件)等等.这里我是用的OLE(COM组件)方式去做的,这种在VC上创建的 ...

  9. NX二次开发-UDO用户自定义对象(UFUN)【持续完善】

    每当提起UDO总是会让我想起大专毕业那会失业找工作,后来有个宝贵机会去了软件公司上班,拿到了我人生中的第一个NX二次开发项目,一个关于测量汽车前后左右摄像头的项目.当时那个项目就用到了UDO,对于只看 ...

随机推荐

  1. leetcode-164周赛-1268-搜索推荐系统

    题目描述: 自己的提交: class Solution: def suggestedProducts(self, products: List[str], searchWord: str) -> ...

  2. 阿里云高磊:API网关加速能力聚合与生态集成

    导读:本文中,阿里云高级技术专家高磊(花名:埃兰)将聚焦API网关加速能力聚合与生态集成,讲述API如何实现系统间的衔接和API网关的产品升级进程,重点展示了一些新功能.新体验和新变化. 大家下午好, ...

  3. Yii2 搜索

    搜索的形式: 第一种,点击空白处: <?php $data=['0'=>'已删除','10'=>'正常','1'=>'锁定']; ?> <table style=' ...

  4. PHP FILTER_VALIDATE_EMAIL 过滤器

    定义和用法 FILTER_VALIDATE_EMAIL 过滤器把值作为 e-mail 地址来验证. Name: "validate_email" ID-number: 274 实例 ...

  5. Springboot Excle导入导出

    Springboot Excle导入导出 导入操作:Excle批量导入 导出操作:下载模版 开发笔记 pom.xml <!-- Excle相关jar --> <dependency& ...

  6. 2019 wannafly winter camp day5-8代码库

    目录 day5 5H div2 Nested Tree (树形dp) 5F div2 Kropki (状压dp) 5J div1 Special Judge (计算几何) 5I div1 Sortin ...

  7. 其它课程中的python---6、python读取数据

    其它课程中的python---6.python读取数据 一.总结 一句话总结: 记常用和特例:慢慢慢慢的就熟了,不用太着急,慢慢来 库的使用都很简单:就是库的常用函数就这几个,后面用的时候学都来得及. ...

  8. share memory

    header for public argument:shmdata.h #define TEXT_SZ 2048 struct shared_use_st { int written; char t ...

  9. PAT_A1083#List Grades

    Source: PAT A1083 List Grades (25 分) Description: Given a list of N student records with name, ID an ...

  10. localStorage使用总结(转载)

    localStorage使用总结  本文转载自:https://www.cnblogs.com/st-leslie/p/5617130.html(点击标题可跳转至原文) 一.什么是localStora ...