zoukankan      html  css  js  c++  java
  • NX二次开发-调系统命令UF_load_library[UFUN调DLL]

    此函数可以调DLL,可以调宏,当然也可以调其他内部函数(知道哪个内部函数怎么用的前提下)。

     1 #include <uf.h>
     2 
     3 
     4 void UFUN_API_Call_DLL(char* dllPath)
     5 {
     6     //调系统命令
     7     typedef void(*load_ufusr_f_p_t)(char* param, int* retcode, int paramLen);
     8     load_ufusr_f_p_t load_ufusr_ptr = NULL;
     9     int irc = UF_load_library(dllPath, "ufusr", (UF_load_f_p_t *)& load_ufusr_ptr);
    10 
    11     //调用DLL
    12     if (load_ufusr_ptr != NULL)
    13     {
    14         int retcode;
    15         load_ufusr_ptr(dllPath, &retcode, 1);
    16     }
    17 
    18     if (irc != 0)
    19     {
    20         uc1601("failed load", 1);
    21         UF_unload_library(dllPath); // 注意该语句只能在失败时被调用,否则UG会退出
    22         return;
    23     }
    24 }
    25 
    26 
    27 UFUN_API_Call_DLL("E:\11111\2.dll");
    28 
    29 Caesar卢尚宇
    30 2019年11月24日

  • 相关阅读:
    2019-11-12-WPF-添加窗口消息钩子方法
    2018-11-21-WPF-解决-ViewBox--不显示线的问题
    ARRAY_SIZE宏
    tcp校验和
    arp命令
    sk_buff
    printf打印字节
    dmesg命令
    insmod/rmmod
    ifup/ifdown
  • 原文地址:https://www.cnblogs.com/nxopen2018/p/11921313.html
Copyright © 2011-2022 走看看