I just noticed something JNA beginners should be aware of:
You might assume that the following code should create a SafeArray being able to hold n elements of type
VT_UI1
, but actually it will hold elements of type VT_VARIANT instead!
OaIdl.SAFEARRAY.createSafeArray(VT_UI1, n))
The correct way is:
OaIdl.SAFEARRAY.createSafeArray(new WTypes.VARTYPE(VT_UI1), n))
HTH
-Markus