Hello,
I’m converting an old Grid control dll from GFA Basic to PowerBASIC. The dll allows multiple Grids to be run from one parent window. Grid string data is stored in a global string two dimensional array, as in, say, gsGridData(Col, Row). So five Grids would require five ‘instances’ of gsGridData(Col, Row).
In the past I’ve been able to do this by saving details of the ‘Array Descriptor Table’ (ADT) for each Grid window to cbWndExtra.
This allowed me to store an ADT by:
MoveMemory lpArrayAddress, gsGridData(), 16
SetWindowLong hGridWnd_1, %DESCRIPTOR_TABLE
and to retrieve another arrays details by:
lpArrayAddress = GetWindowLong(hGridWnd_2, %DESCRIPTOR_TABLE )
MoveMemory GridData$(), lpArrayAddress, 16
What I want to know is can I do this using PowerBASIC?
Assuming I can, my next question is where is a string array’s ADT located? According to the manual, PB’s Array Descriptor Table is 16 bytes. Please tell it’s located somewhere easy to obtain like:
lpArrayAddress = VARPTR( gsGridData(0, 0) ) - 16
Pat Bullman
I’m converting an old Grid control dll from GFA Basic to PowerBASIC. The dll allows multiple Grids to be run from one parent window. Grid string data is stored in a global string two dimensional array, as in, say, gsGridData(Col, Row). So five Grids would require five ‘instances’ of gsGridData(Col, Row).
In the past I’ve been able to do this by saving details of the ‘Array Descriptor Table’ (ADT) for each Grid window to cbWndExtra.
This allowed me to store an ADT by:
MoveMemory lpArrayAddress, gsGridData(), 16
SetWindowLong hGridWnd_1, %DESCRIPTOR_TABLE
and to retrieve another arrays details by:
lpArrayAddress = GetWindowLong(hGridWnd_2, %DESCRIPTOR_TABLE )
MoveMemory GridData$(), lpArrayAddress, 16
What I want to know is can I do this using PowerBASIC?
Assuming I can, my next question is where is a string array’s ADT located? According to the manual, PB’s Array Descriptor Table is 16 bytes. Please tell it’s located somewhere easy to obtain like:
lpArrayAddress = VARPTR( gsGridData(0, 0) ) - 16
Pat Bullman
Comment