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..."); ccs.sendMessage("§bInitializing bridge...");
Bridge.setVerbose(true);
Bridge.init(getDataFolder().getAbsoluteFile()); Bridge.init(getDataFolder().getAbsoluteFile());
Bridge.getSetup().setVeryVerbose(true);
Bridge.LoadAndRegisterAssemblyFrom(new File(getDataFolder(), "VirtualComputerWindows.j4n.dll")); Bridge.LoadAndRegisterAssemblyFrom(new File(getDataFolder(), "VirtualComputerWindows.j4n.dll"));
} }
final VirtualBoxManager manager = VirtualBoxManager.createInstance(getDataFolder().getAbsolutePath()); final VirtualBoxManager manager = VirtualBoxManager.createInstance(getDataFolder().getAbsolutePath());

View file

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

View file

@ -17,7 +17,7 @@ namespace VirtualComputerWindows
private static VirtualBoxClient vbc; private static VirtualBoxClient vbc;
public static void Init() private static void Init()
{ {
try try
{ {
@ -48,7 +48,9 @@ namespace VirtualComputerWindows
private static void Main() private static void Main()
{ {
Init(); //Init();
long asd = GetEventHandler(null);
Console.WriteLine("Returned: " + asd);
Console.ReadLine(); Console.ReadLine();
} }
@ -56,13 +58,13 @@ namespace VirtualComputerWindows
public static long GetFrameBuffer(IMCFrameBuffer framebuffer) public static long GetFrameBuffer(IMCFrameBuffer framebuffer)
{ {
var fb = new WinFrameBuffer(framebuffer); var fb = new WinFrameBuffer(framebuffer);
return (long) Marshal.GetIDispatchForObject(fb); return (long) Marshal.GetIUnknownForObject(fb);
} }
public static long GetEventHandler(IEventHandler handler) public static long GetEventHandler(IEventHandler handler)
{ {
var han = new EventHandler(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> <modelVersion>4.0.0</modelVersion>
<groupId>io.github.NorbiPeti</groupId> <groupId>io.github.NorbiPeti</groupId>
<artifactId>VirtualComputer-Windows</artifactId> <artifactId>VirtualComputer-Windows</artifactId>
<version>0.8.9.0</version> <version>3.0</version>
<description>POM was created from install:install-file</description> <description>POM was created from install:install-file</description>
</project> </project>

View file

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