/// <summary> /// 初始化dll /// </summary> /// <param name="PipeDllName"></param> /// <returns></returns> public bool InitDll(String DllName) { try { if (_InvokeDll == null) { _InvokeDll = new InvokeDll(DllName); } if (_InvokeDll != null) { _Emf2Svg = (InvokeEmf2Svg)_InvokeDll.Invoke("_Emf2Svg@8", typeof(InvokeEmf2Svg)); } if (_InitDll != null) { _ndllPtr = _InitDll(); if (_ndllPtr != null) { return(true); } } } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.Message); } return(false); }
/// <summary> /// 退出时调用 /// </summary> public bool UnInitDll() { try { if (_UnInitDll != null) { if (_ndllPtr != null) { bool bSuccess = _UnInitDll(_ndllPtr); _InvokeDll = null; GC.Collect(); return(bSuccess); } } } catch { } return(false); }