此函數可以調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日