public void Dispose() { //call destructor _OpenBR4Net_Destructor(_cpp); //release memory Marshal.FreeHGlobal((IntPtr)_cpp); _cpp = null; }
public OpenBR4Net() { //Allocate storage for object _cpp = (__OpenBR4Net *)Marshal.AllocHGlobal(sizeof(__OpenBR4Net)); //Call constructor if (Environment.CurrentDirectory.Contains("OpenBR4Net")) { SetDllDirectory(Environment.CurrentDirectory + "\\OpenBR4Net"); //System.IO.Directory.SetCurrentDirectory(Environment.CurrentDirectory + "\\OpenBR4Net"); } //if (Environment.GetEnvironmentVariable("QTDIR") == null) // If it doesn't exist, create it. //Environment.SetEnvironmentVariable("envName", Environment.CurrentDirectory + "\\OpenBR4Net"); _OpenBR4Net_Constructor(_cpp, 1); }
private static extern int _verify(__OpenBR4Net *ths, string query, string target, ref float score);
private static extern bool _isInitialized(__OpenBR4Net *ths);
private static extern int _getSecondEye(__OpenBR4Net *ths, string file, ref int x, ref int y);
private static extern int _getTemplate(__OpenBR4Net *ths, string file, string templateFilename);
private static extern void _finalize(__OpenBR4Net *ths);
private static extern void _initialize(__OpenBR4Net *ths, string bibfile);
private static extern int _OpenBR4Net_Destructor(__OpenBR4Net *ths);
private static extern int _OpenBR4Net_Constructor(__OpenBR4Net *ths, int value);