本帖最后由 LIUCHANGLIN 于 2011-9-29 21:32 编辑
生成的向导文件!
#include <stdio.h>
#include <stdlib.h>
#include <uf.h>
#include <uf_ui.h>
#include <afxwin.h>
#include <uf_part.h>
#pragma comment (lib,"libufun.lib")
#pragma comment (lib,"libugopenint.lib")
#define UF_CALL(X) (report_error( __FILE__, __LINE__, #X, (X)))
static int report_error(char *file,int line, char *call,int irc)
{
if(irc)
{
char err[133],msg[133];
sprintf(msg, "*** ERROR code %d at line %d in %s:\n+++ ",irc,line,file);
UF_get_fail_message(irc,err);
/*NOTE:UF_PRINT_SYSLOG IS NEW IN V18*/
UF_print_syslog(msg,FALSE);
UF_print_syslog(err,FALSE);
UF_print_syslog("\n",FALSE);
UF_print_syslog(call,FALSE);
UF_print_syslog(";\n",FALSE);
if(!UF_UI_open_listing_window())
{
UF_UI_write_listing_window(msg);
UF_UI_write_listing_window(err);
UF_UI_write_listing_window("\n");
UF_UI_write_listing_window(call);
UF_UI_write_listing_window(";\n");
}
}
return(irc);
}
//在这里写入主程序
static void do_ugopen_api(void)
{
uc1601("专业CNC加工",1);
}
//程序入口函数
void ufusr(char *param, int *retcode, int param_len)
{
if (UF_CALL(UF_initialize())) return;
if (UF_PART_ask_display_part() != NULL_TAG)
{
do_ugopen_api();
}
else
uc1601("No active part", 1);
UF_terminate();
}
int ufusr_ask_unload(void)
{
return (UF_UNLOAD_IMMEDIATELY);
}
|