3# zjs
#include <uf.h>
#include"stdio.h"
#include<uf_ui.h>
#define UF_CALL(X)(report(__FILE__,__LINE__,#X,(X)))
static int report( char *file, int line, char *call, int irc)
{
if (irc)
{
char messg[133];
printf("%s, line %d: %s\n", file, line, call);
(UF_get_fail_message(irc, messg)) ?
printf(" returned a %d\n", irc) :
printf(" returned error %d: %s\n", irc, messg);
}
return(irc);
}
static void do_ugopen_api(void)
{
UF_CURVE_line_p_t line_coords ;
tag_t line;
line_coords->start_point[0]=0.0;
line_coords->start_point[1]=0.0;
line_coords->start_point[2]=0.0;
line_coords->end_point[0]=1.0;
line_coords->end_point[1]=1.0;
line_coords->end_point[2]=1.0;
//创建一条直线;
UF_CALL(UF_CURVE_create_line(line_coords,&line));
extern DLLExport void ufusr (char*parm,int*returnCode,int rlen)
{
if(!UF_CALL(UF_initialize()))//获取二次开发许可
{
do_ugopen_api();
UF_CALL(UF_terminate());//释放二次开发许可
}
else
{
uc1601("获取二次开发失败",1);
}
}
//添加卸载函数
int ufusr_ask_unload(void)
{
return (UF_unload_IMMEDIATELY);
}
你给看一下这个程序吧,谢谢了
qq409456559
能不能留下你的qq |