Fix sending the reference to COM object

Basically 2 lines of actual code change
This commit is contained in:
Norbi Peti 2020-11-23 00:34:32 +01:00
parent 5adc49d40a
commit 17c3d4c268
13 changed files with 10 additions and 10 deletions

View file

@ -93,9 +93,7 @@ public class PluginMain extends JavaPlugin {
}
}
ccs.sendMessage("§bInitializing bridge...");
Bridge.setVerbose(true);
Bridge.init(getDataFolder().getAbsoluteFile());
Bridge.getSetup().setVeryVerbose(true);
Bridge.LoadAndRegisterAssemblyFrom(new File(getDataFolder(), "VirtualComputerWindows.j4n.dll"));
}
final VirtualBoxManager manager = VirtualBoxManager.createInstance(getDataFolder().getAbsolutePath());

View file

@ -29,7 +29,7 @@
<dependency>
<groupId>io.github.NorbiPeti</groupId>
<artifactId>VirtualComputer-Windows</artifactId>
<version>0.8.9.0</version>
<version>3.0</version>
</dependency>
<dependency>
<groupId>net.sf.jacob-project</groupId>

View file

@ -17,7 +17,7 @@ namespace VirtualComputerWindows
private static VirtualBoxClient vbc;
public static void Init()
private static void Init()
{
try
{
@ -48,7 +48,9 @@ namespace VirtualComputerWindows
private static void Main()
{
Init();
//Init();
long asd = GetEventHandler(null);
Console.WriteLine("Returned: " + asd);
Console.ReadLine();
}
@ -56,13 +58,13 @@ namespace VirtualComputerWindows
public static long GetFrameBuffer(IMCFrameBuffer framebuffer)
{
var fb = new WinFrameBuffer(framebuffer);
return (long) Marshal.GetIDispatchForObject(fb);
return (long) Marshal.GetIUnknownForObject(fb);
}
public static long GetEventHandler(IEventHandler handler)
{
var han = new EventHandler(handler);
return (long) Marshal.GetIDispatchForObject(han);
return (long)Marshal.GetIUnknownForObject(han);
}
}
}

View file

@ -4,6 +4,6 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.NorbiPeti</groupId>
<artifactId>VirtualComputer-Windows</artifactId>
<version>0.8.9.0</version>
<version>3.0</version>
<description>POM was created from install:install-file</description>
</project>

View file

@ -3,9 +3,9 @@
<groupId>io.github.NorbiPeti</groupId>
<artifactId>VirtualComputer-Windows</artifactId>
<versioning>
<release>0.8.9.0</release>
<release>3.0</release>
<versions>
<version>0.8.9.0</version>
<version>3.0</version>
</versions>
<lastUpdated>20201121164706</lastUpdated>
</versioning>