#include"uf_all.h" char* dllPath = "D:\\1.dll"; void UFUN_API_Call_DLL(char* dllPath) { //调系统命令 typedef void(*load_ufusr_f_p_t)(char* param, int* retcode, int paramLen); load_ufusr_f_p_t load_ufusr_ptr = NULL; int irc = UF_load_library(dllPath, "ufusr", (UF_load_f_p_t *)& load_ufusr_ptr); //调用DLL if (load_ufusr_ptr != NULL) { int retcode; load_ufusr_ptr(dllPath, &retcode, 1); } if (irc != 0) { uc1601("failed load", 1); UF_unload_library(dllPath); // 注意该语句只能在失败时被调用,否则UG会退出 return; } } extern DllExport void ufusr(char *param, int *returnCode, int rlen) { UFUN_API_Call_DLL(dllPath); } extern int ufusr_ask_unload(void) { return (UF_UNLOAD_IMMEDIATELY); }