Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Feb : API TabbedTextOut problem

www.cryer.info
Managed Newsgroup Archive

API TabbedTextOut problem

Subject:API TabbedTextOut problem
Posted by:"Dave Atkin" (sepultur..@optusnet.com.au)
Date:Sat, 26 Feb 2005 09:31:27

Hi everyone,

Firstly, I'm new to this list - so greetings from Australia to everyone.

Now to my problem. I'm subclassing a TCustomComboBox to display items in the
dropdown list in a tabular form.
Im using the Windows API function TabbedTextOut to do this.
The following code works flawlessly if TabArray is declared as a static
array, so:
TabArray : Array[0..2] of integer;  TabArray[0] := 10; etc..

      TabbedTextOut(Canvas.Handle,
                    Rect.Left + MARGIN,
                    Rect.Top,
                    PChar(Items[Index]),
                    Length(Items[Index]),
                    fTabList.Count,
                    TabArray,
                    0);

However, if I declare TabArray as a dynamic array, so:
TabArray: array of integer;   SetLength(TabArray,3); TabArray[0] := 10; etc
the function fails.
Can anyone tell me why this is, and how to fix it?

Thanks,

Dave Atkin

Replies:

www.cryer.info
Managed Newsgroup Archive