// 定义 typedef int __stdcall MyFunction (int x, char *str); int rtn = 0; String dllName = "XXXX.dll"; HINSTANCE hInstance = LoadLibrary(dllName.c_str()); MyFunction * pMyFunction = (MyFunction*) GetProcAddress(hInstance, "rdcompany"); // 函数名称要正确 if (pMyFunction == NULL) { // 提示 } rtn = pMyFunction(1, "aa"); FreeLibrary(hInstance); hInstance = NULL;
时间: 2024-10-12 20:22:24