Hi Stefan,
if you look in the "temp" directory underneath the Jabaco program directory, you'll find the compiled Java classes of your example.
Decompiling the Form1.class yields the following:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
private long MultiByteToWideChar(long CodePage, long dwFlags, String lpMultiByteStr, long cchMultiByte,
String lpWideCharStr, long cchWideChar)
{
long MultiByteToWideChar = 0L;
Exception Err = null;
Exception h15 = null;
VBA.VBArrayVariant vbarrayvariant = VBArray.createParamArray(5);
vbarrayvariant.setValueVar(0, VBVariant.valueOf(CodePage));
vbarrayvariant.setValueVar(1, VBVariant.valueOf(dwFlags));
vbarrayvariant.setValueVar(2, VBVariant.valueOf(lpMultiByteStr));
vbarrayvariant.setValueVar(3, VBVariant.valueOf(cchMultiByte));
vbarrayvariant.setValueVar(4, VBVariant.valueOf(lpWideCharStr));
vbarrayvariant.setValueVar(5, VBVariant.valueOf(cchWideChar));
MultiByteToWideChar = Interaction.NativeCall("kernel32.dll", "MultiByteToWideChar", vbarrayvariant).longValue();
return MultiByteToWideChar;
}
|
There is no "way back" from NativeCall to copy the lpWideCharStr bytes into the variable of the calling routine.
So, you are right assuming that there is a bug. Jabaco's NativeCall implementation cannot handle output parameters.
You might want to have a look at the
lengthy discussion on this subject which was posted a while ago.
Let's hope for the forthcoming release.
Greetings!
A1880