public IndigoInchi(Indigo indigo) { String dllpath = indigo.getDllPath(); string libraryName; IndigoDllLoader dll_loader = IndigoDllLoader.Instance; switch (Environment.OSVersion.Platform) { case PlatformID.Win32NT: libraryName = "indigo-inchi.dll"; dll_loader.loadLibrary(dllpath, libraryName, "com.ggasoftware.indigo.Properties.ResourcesWin", false); break; case PlatformID.Unix: if (IndigoDllLoader.isMac()) { libraryName = "libindigo-inchi.dylib"; dll_loader.loadLibrary(dllpath, libraryName, "com.ggasoftware.indigo.Properties.ResourcesMac", false); } else { libraryName = "libindigo-inchi.so"; dll_loader.loadLibrary(dllpath, libraryName, "com.ggasoftware.indigo.Properties.ResourcesLinux", false); } break; default: throw new PlatformNotSupportedException(String.Format("Unsupported platform: {0}", Environment.OSVersion.Platform)); } _inchi_lib = dll_loader.getInterface <IndigoInchiLib> (libraryName); _indigo = indigo; }
public IndigoInchi(Indigo indigo) { String dllpath = indigo.getDllPath(); IndigoDllLoader dll_loader = IndigoDllLoader.Instance; dll_loader.loadLibrary(dllpath, "indigo-inchi.dll", "com.ggasoftware.indigo.Properties.Resources", false); _inchi_lib = dll_loader.getInterface <IndigoInchiLib>("indigo-inchi.dll"); _indigo = indigo; }
private void init(string lib_path) { IndigoDllLoader dll_loader = IndigoDllLoader.Instance; dll_loader.loadLibrary(lib_path, "msvcr100.dll", "com.ggasoftware.indigo.Properties.Resources", false); //dll_loader.loadLibrary(lib_path, "zlib.dll", "com.ggasoftware.indigo.Properties.Resources", false); dll_loader.loadLibrary(lib_path, "indigo.dll", "com.ggasoftware.indigo.Properties.Resources", false); // Save instance id to check if session was allocated for this instance _dll_loader_id = IndigoDllLoader.InstanceId; _dllpath = lib_path; _indigo_lib = dll_loader.getInterface <IndigoLib>("indigo.dll"); _sid = _indigo_lib.indigoAllocSessionId(); _indigo_lib.indigoSetSessionId(_sid); _errh = new ErrorHandler(_handleError); _indigo_lib.indigoSetErrorHandler(_errh, this); }
private void init(string lib_path) { string libraryName; dll_loader = IndigoDllLoader.Instance; switch (Environment.OSVersion.Platform) { case PlatformID.Win32NT: libraryName = "indigo.dll"; bool vs2010 = true; bool vs2012 = true; bool vs2013 = true; try { dll_loader.loadLibrary(lib_path, "msvcr100.dll", "com.ggasoftware.indigo.Properties.ResourcesWin2010", false); } catch { vs2010 = false; } try { dll_loader.loadLibrary(lib_path, "msvcr110.dll", "com.ggasoftware.indigo.Properties.ResourcesWin2012", false); } catch { vs2012 = false; } try { dll_loader.loadLibrary(lib_path, "msvcr120.dll", "com.ggasoftware.indigo.Properties.ResourcesWin2013", false); } catch { vs2013 = false; } if (vs2010) { dll_loader.loadLibrary(lib_path, "msvcr100.dll", "com.ggasoftware.indigo.Properties.ResourcesWin2010", false); dll_loader.loadLibrary(lib_path, "msvcp100.dll", "com.ggasoftware.indigo.Properties.ResourcesWin2010", false); dll_loader.loadLibrary(lib_path, libraryName, "com.ggasoftware.indigo.Properties.ResourcesWin2010", false); } else if (vs2012) { dll_loader.loadLibrary(lib_path, "msvcr110.dll", "com.ggasoftware.indigo.Properties.ResourcesWin2012", false); dll_loader.loadLibrary(lib_path, "msvcp110.dll", "com.ggasoftware.indigo.Properties.ResourcesWin2012", false); dll_loader.loadLibrary(lib_path, libraryName, "com.ggasoftware.indigo.Properties.ResourcesWin2012", false); } else if (vs2013) { dll_loader.loadLibrary(lib_path, "msvcr120.dll", "com.ggasoftware.indigo.Properties.ResourcesWin2013", false); dll_loader.loadLibrary(lib_path, "msvcp120.dll", "com.ggasoftware.indigo.Properties.ResourcesWin2013", false); dll_loader.loadLibrary(lib_path, libraryName, "com.ggasoftware.indigo.Properties.ResourcesWin2013", false); } break; case PlatformID.Unix: if (IndigoDllLoader.isMac()) { libraryName = "libindigo.dylib"; dll_loader.loadLibrary(lib_path, libraryName, "com.ggasoftware.indigo.Properties.ResourcesMac", false); } else { libraryName = "libindigo.so"; dll_loader.loadLibrary(lib_path, libraryName, "com.ggasoftware.indigo.Properties.ResourcesLinux", false); } break; default: throw new PlatformNotSupportedException(String.Format("Unsupported platform: {0}", Environment.OSVersion.Platform)); } // Save instance id to check if session was allocated for this instance _dll_loader_id = IndigoDllLoader.InstanceId; _dllpath = lib_path; _indigo_lib = dll_loader.getInterface <IndigoLib>(libraryName); _sid = _indigo_lib.indigoAllocSessionId(); _indigo_lib.indigoSetSessionId(_sid); }