public void initPath(string dllpath) { if (DllLib == IntPtr.Zero) { DllLib = LoadDllAPI.LoadLibrary(dllpath); } }
/// <summary> /// 获取DLL中一个方法的委托 /// </summary> /// <param name="methodname"></param> /// <param name="methodtype"></param> /// <returns></returns> public Delegate InvokeMethod(string methodname, Type methodtype) { IntPtr MethodPtr = LoadDllAPI.GetProcAddress(DllLib, methodname); return((Delegate)Marshal.GetDelegateForFunctionPointer(MethodPtr, methodtype)); }
public LoadDll(string dllpath) { DllLib = LoadDllAPI.LoadLibrary(dllpath); }