# Tuesday, 15 November 2011
« IKVM.NET 7.0 Release Candidate 0 | Main | New Development Snapshot »
New Development Snapshot

Hot on the heels of the 7.0 release candidate, the first development snapshot of 7.1. The most visible change is a new feature. The ikvm.lang.DllExport annotation to export static methods as unmanaged entry points.

Here's a crazy example:

import ikvm.lang.DllExport;
import cli.System.Runtime.InteropServices.DllImportAttribute;

public class test {
  @DllExport(name = "Foo", ordinal = 42)
  static void Dummy() {
    System.out.println("Hello World");
  }

  @DllImportAttribute.Annotation("test.exe")
  static native void Foo();

  public static void main(String[] args) {
    Foo();
  }

Compile as follows:

ikvmstub mscorlib
javac -cp \ikvm\lib\ikvm-api.jar;mscorlib.jar test.java
ikvmc test.class -r:mscorlib -platform:x86

The DllExport annotation only works when you explicitly specify -platform:x86 or -platform:x64. In the future ARM will also be supported, but I'll need to have an ARM Windows 8 system first. Since it emits an unmanaged entry point, the resulting assembly is a platform specific mixed assembly.

Changes:

  • Updated version to 7.1.4336.0.
  • Added ikvmc warnings for referencing non-primary assembly in shared class loader group and duplicate references.
  • Removed ikvmc -platform:Itanium option.
  • Added ikvm.lang.DllExport annotation to export static methods as unmanaged exports.
  • Implemented a different pinning scheme for GetPrimitiveArrayCritical() that tolerates broken code that passes back the wrong pointer to Release. Should also perform better in most cases. GetStringCritical() now also pins instead of copies. Note that we intentionally ignore the mode parameter in ReleasePrimitiveArrayCritical() as HotSpot does the same.
  • Added include stdarg.h to jni.h make the header file compile by itself.
  • Added JNI_TRUE and JNI_FALSE to jni.h.
  • IKVM.Reflection: Fixed various assembly name parsing bugs in managed Fusion CompareAssemblyIdentity.
  • IKVM.Reflection: Re-implemented (most of) AssemblyName without dependency on System.Reflection.AssemblyName.

Binaries available here: ikvmbin-7.1.4336.zip

Tuesday, 15 November 2011 07:25:45 (W. Europe Standard Time, UTC+01:00)  #    Comments [1]
Wednesday, 30 November 2011 09:23:14 (W. Europe Standard Time, UTC+01:00)
First thank you for an excellent translation system which we are using a lot with great success.

I have tried out the latest snapshot as we would like to access an IKVMed dll directly from Excel VBA. Up to now we have done this by wrapping the IKVMed jar inC#. Making the methods COM-visible works fine, but the system crashes when trying to run the code. Our platform is Windows XP and Excel 2007.

The event is:
Event Type: Error
Event Source: Microsoft Office 12
Event Category: None
Event ID: 1000
Date: 30.11.2011
Time: 09:14:13
User: N/A
Computer: X5KNY
Description:
Faulting application excel.exe, version 12.0.6565.5003, stamp 4e5fe1a6, faulting module kernel32.dll, version 5.1.2600.5781, stamp 49c4f482, debug? 0, fault address 0x00012afb.

Do you have any hint to what the problem might be?

Regards
Kim
Kim Kolstad
Name
E-mail
Home page

I apologize for the lameness of this, but the comment spam was driving me nuts. In order to be able to post a comment, you need to answer a simple question. Hopefully this question is easy enough not to annoy serious commenters, but hard enough to keep the spammers away.

Anti-Spam Question: What method on java.lang.System returns an object's original hashcode (i.e. the one that would be returned by java.lang.Object.hashCode() if it wasn't overridden)? (case is significant)

Answer:  
Comment (HTML not allowed)  

Live Comment Preview