I've been working on getting the SWT (the Eclipse windowing toolkit) examples to run. This mostly involved implementing a lot of JNI methods.
The examples now run, but they do run into the occasional random NullPointerException. Probably caused by a sneaky bug in the (un)managed C++ code.
Here is a statically compiled version ControlExample (including all the supporting DLLs needed).
Note that this will only run on Windows, because my JNI implementation is written in Managed C++ it will not run on Mono.
Some interesting findings:
- SWT has a reference to the sun.awt.windows.WEmbeddedFrame class. What's that about?
- In order to get the FileViewer example to run, I had to use the STAThread attribute on my main method. Boy I'm I glad I missed the whole COM thing (was busy doing Java). This just too lame.
- Reflection.Emit does not support embedding resources in a module (lame!). I had to add resource support to ikvmc (and the VM) to get ControlExample to work, statically compiled, so I added initialized global public fields to the assembly and used System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray to copy the field data to an array.
9:32:32 AM Comments
|