It appears to me that I've got a code quite similar to that, but a bit more flexible:
code:
// Create the BUTTONS "array"
var BUTTONS = Interop.Allocate(Math.min(arrButtonIds.length,arrButtonLabels.length) * 8);
// Create the array for the buttons and the button labels
var BUTTONS_ARRAY = new Array();
var BUTTONTEXTS = new Array();
// Write'em all into a DataBlock object
for(var i = 0; i < Math.min(arrButtonIds.length,arrButtonLabels.length); i++) {
// Write the current button's label into a DataBlock object
BUTTONTEXTS[i] = Interop.Allocate((arrButtonLabels[i].length + 1) * 2);
BUTTONTEXTS[i].writeSTRING(0,arrButtonLabels[i]);
// Write the remaining required data into a DataBlock object
BUTTONS_ARRAY[i] = Interop.Allocate(4 + Math.min(arrButtonIds.length,arrButtonLabels.length) * 8);
with(BUTTONS_ARRAY[i]) {
writeDWORD(0,arrButtonIds[i]);
writeDWORD(4,BUTTONTEXTS[i].DataPtr);
}
}
}
Just an additional note: I'm pretty tired ATM, so I may start to make big mistakes over time..
EDIT::
Matti,
I've implemented your code (thank you for giving me another half hour of work
), yet nothing happens, neither on my screen, nor in the debugger. I'm not going to sort this out today any more (like I said before, I'm tired).
EDIT::
I seem to get E_INVALIDARG errors, an indication of either a stupid typo, or a major error..