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日


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM