protected static unsafe void Process(IntPtr settings) { if (_Process == null) { #if USE_MEMORY_MODULE byte[] data = QChkUI.Properties.Resources.QCHK; mem = new MemoryModule(data); _Process = (ProcessFunc)mem.GetDelegateFromFuncName(0, typeof(ProcessFunc)); #else IntPtr pDll = LoadLibrary("QCHK.dll"); IntPtr pAddressOfFunctionToCall0 = GetProcAddress(pDll, (IntPtr)1); _Process = (ProcessFunc)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall0, typeof(ProcessFunc)); #endif } _Process(settings); }
protected static unsafe void Process(IntPtr settings) { if (_Process == null) { #if USE_MEMORY_MODULE byte[] data = TranslatorUI.Properties.Resources.TranslateLib; mem = new MemoryModule(data); _Process = (ProcessFunc)mem.GetDelegateFromFuncName(0, typeof(ProcessFunc)); #else IntPtr pDll = LoadLibrary("C:\\Users\\Tom\\Desktop\\Documents\\Visual Studio 2015\\Projects\\TranslateLib\\Debug\\TranslateLib.dll"); IntPtr pAddressOfFunctionToCall0 = GetProcAddress(pDll, (IntPtr)1); _Process = (ProcessFunc)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall0, typeof(ProcessFunc)); #endif } _Process(settings); }