public static int Create(uint nAPIVersion, System.IntPtr pReserved, ref IPXV_Plugin ppPlugin) { //resolve some mistakes with path to dll(s) AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.AssemblyResolve += new ResolveEventHandler(LoadFromSameFolder); //create plugins ppPlugin = new MyTestPlugin(); return(0); }
public static int Create(uint nAPIVersion, System.IntPtr pReserved, ref IPXV_Plugin ppPlugin) { //resolve some mistakes with path to dll(s) AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.AssemblyResolve += new ResolveEventHandler(LoadFromSameFolder); string folderPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string assemblyPath = Path.Combine(folderPath, "PluginSample.dll"); Assembly.LoadFrom(assemblyPath); return(_Create(nAPIVersion, pReserved, ref ppPlugin)); //int res = -2147467259;// E_FAIL; //create plugins // IPXV_Plugin pp = ppPlugin; }
static int _Create(uint nAPIVersion, System.IntPtr pReserved, ref IPXV_Plugin ppPlugin) { return(PluginSample.MyTestPlugin.Create(nAPIVersion, pReserved, ref ppPlugin)); }