public bool Init(string ourversion, string dllfolder, EDDDLLIF.EDDCallBacks callbacks)
        {
            if (pDll != IntPtr.Zero)
            {
                IntPtr peddinit = BaseUtils.Win32.UnsafeNativeMethods.GetProcAddress(pDll, "EDDInitialise");

                EDDDLLIF.EDDInitialise edinit = (EDDDLLIF.EDDInitialise)Marshal.GetDelegateForFunctionPointer(
                    peddinit,
                    typeof(EDDDLLIF.EDDInitialise));
                Version = edinit(ourversion, dllfolder, callbacks);

                bool ok = Version != null && Version.Length > 0 && Version[0] != '!';

                if (ok)
                {
                    return(true);
                }
                else
                {
                    BaseUtils.Win32.UnsafeNativeMethods.FreeLibrary(pDll);
                    pDll = IntPtr.Zero;
                }
            }

            return(false);
        }
        // return loaded, failed, notallowed
        public Tuple <string, string, string> Load(string directory, string ourversion, string dllfolder, EDDDLLIF.EDDCallBacks callbacks, string allowed)
        {
            string loaded     = "";
            string failed     = "";
            string notallowed = "";

            if (!Directory.Exists(directory))
            {
                failed = "DLL Folder does not exist";
            }
            else
            {
                FileInfo[] allFiles = Directory.EnumerateFiles(directory, "*.dll", SearchOption.TopDirectoryOnly).Select(f => new FileInfo(f)).OrderBy(p => p.LastWriteTime).ToArray();

                string[] allowedfiles = allowed.Split(',');

                foreach (FileInfo f in allFiles)
                {
                    string filename = System.IO.Path.GetFileNameWithoutExtension(f.FullName);

                    EDDDLLCaller caller = new EDDDLLCaller();

                    if (caller.Load(f.FullName))                                                                                                                              // if loaded (meaning it loaded, and its got EDDInitialise)
                    {
                        if (allowed.Equals("All", StringComparison.InvariantCultureIgnoreCase) || allowedfiles.Contains(filename, StringComparer.InvariantCultureIgnoreCase)) // if allowed..
                        {
                            if (caller.Init(ourversion, dllfolder, callbacks))                                                                                                // must init
                            {
                                dlls.Add(caller);
                                loaded = loaded.AppendPrePad(caller.Name, ",");
                            }
                            else
                            {
                                string errstr = caller.Version.HasChars() ? (": " + caller.Version.Substring(1)) : "";
                                failed = failed.AppendPrePad(caller.Name + errstr, ",");
                            }
                        }
                        else
                        {
                            notallowed = notallowed.AppendPrePad(caller.Name, ",");
                        }
                    }
                }
            }

            return(new Tuple <string, string, string>(loaded, failed, notallowed));
        }