NX二次开发源码分享: 打开一个指定的文件
NX二次开发源码分享: 打开一个指定的文件
static void report_load_status(UF_PART_load_status_p_t status)
{
int
ii;
char
msg;
if (status->n_parts > 0)
{
ECHO("Load notes:\n");
for (ii = 0; ii < status->n_parts; ii++)
{
UF_get_fail_message(status->statuses, msg);
ECHO("%s - %s\n", status->file_names, msg);
}
ECHO("\n");
UF_CALL(UF_PART_free_load_status(status));
}
}
static void do_it(void)
{
int
resp;
logical
disp = FALSE;
tag_t
part;
char
file_name = { "" };
UF_PART_load_status_t
status;
if (!(UF_CALL(UF_UI_ask_open_part_filename(file_name, &disp, &resp))) &&
(resp == UF_UI_OK) &&
(UF_CALL(UF_PART_open(file_name, &part, &status)))
|| status.n_parts > 0)
report_load_status(&status);
}
页:
[1]