dsj12345 发表于 2017-9-29 15:41:10

UG自动加载的问题

#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <uf.h>
#include <uf_ui.h>
#include (uf_exit.h>

static void ECHO(char *format, ...)
{
    char msg;
    va_list args;
    va_start(args, format);
    vsprintf(msg, format, args);
    va_end(args);
    UF_UI_open_listing_window();
    UF_UI_write_listing_window(msg);
    UF_print_syslog(msg, FALSE);
}

#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;

      UF_get_fail_message(irc, err);
      ECHO("*** ERROR code %d at line %d in %s:\n",
            irc, line, file);
      ECHO("+++ %s\n", err);
      ECHO("%s;\n", call);
    }

    return(irc);
}

static void do_it(void)
{
    ECHO("Running ufput user exit - part will not be saved");
}

/*ARGSUSED*/
void ufput(char *param, int *retcode, int paramLen)
{
    if (UF_CALL(UF_initialize())) return;
    do_it();
    *retcode = 1; // Set to 0 to have NX perform the Save
    UF_terminate();
}

int ufusr_ask_unload(void)
{
    return (UF_UNLOAD_IMMEDIATELY);
}
这个是帮助文档里user exit的一个例子,为什么我执行之后不起作用啊。。。
生成的dll放在了startup里边
是不是还要改环境变量之类的东西?求大神指点啊

dsj12345 发表于 2017-9-30 09:55:46

已解决,USER_FILE指向dll就可以了

别哭* 发表于 2017-9-29 17:06:55

不懂帮顶

wang124 发表于 2025-1-21 11:04:34

dsj12345 发表于 2017-9-30 09:55
已解决,USER_FILE指向dll就可以了

您好!我在NX 12.0\STAMPING_TOOLS目录下放了dll插件,也是打开ug时候没有自动加载此dll。是什么原因呢?
页: [1]
查看完整版本: UG自动加载的问题