I have an owner drawn combo box that displays the strings in columns. The drawing routine can be shared across combos if I can somehow pass the column specifications to the OnDrawItem event. A natural way to do so, would be to pass the array of column widths in the ComboBox.Tag property and then cast it back to an array.
When I define the column array as:
const arrWidth :array[1..4] of integer = (100,100,100,70);
and set the Tag property to:
ComboBox.Tag := integer(@arrWidth);
and then in the OnDrawItem event, cast it back to an array:
Widths :array of integer;
Widths := pointer(ComboBox.Tag);
I can see the array elements fine, but the array does not know it's length. It appears to be much longer with all sorts of random values.
I have tried using a dynamic array, but then I don't even get the proper column values.