public NativeMethods(string path) { this.hLibrary = GetLibrary(path); if (this.hLibrary == IntPtr.Zero) { throw new Exception($"NativeMethods({path})"); } this._TheFunc = GetFunction <_TheFuncDelegate>("TheFunc"); this._FuncName = GetFunction <_FuncNameDelegate>("FuncName"); }
public LibToolscs(string path) { IntPtr hLib = GetLibrary(path); if (hLib != IntPtr.Zero) { _theFunc = GetFunc <_TheFuncDelegate>("TheFunc", hLib); _funcName = GetFunc <_FuncNameDelegate>("FuncName", hLib); } else { throw new Exception(); } }