示例#1
0
 public void initPath(string dllpath)
 {
     if (DllLib == IntPtr.Zero)
     {
         DllLib = LoadDllAPI.LoadLibrary(dllpath);
     }
 }
示例#2
0
        /// <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));
        }
示例#3
0
 public LoadDll(string dllpath)
 {
     DllLib = LoadDllAPI.LoadLibrary(dllpath);
 }