TVirtualStringTree compatibility between Delphi 7 and Delphi 2010 - 'Parameter lists differ'

Posted by Brian Frost on Stack Overflow See other posts from Stack Overflow or by Brian Frost
Published on 2010-04-20T13:24:10Z Indexed on 2010/04/20 15:13 UTC
Read the original article Hit count: 1417

Hi, I've made a form containing a TVirtualStringTree that works in Delphi 7 and Delphi 2010. I notice that as I move between the two platforms I get the message '...parameter list differ..' on the tree events and that the string type is changing bewteen TWideString (D7) and string (D2010). The only trick I've found to work to suppress this error is to use compiler directives as follows:

   {$IFDEF TargetDelphi7}
    procedure VirtualStringTree1GetText(Sender: TBaseVirtualTree;
      Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
      var CellText: WideString);
    {$ELSE}
    procedure VirtualStringTree1GetText(Sender: TBaseVirtualTree;
      Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
      var CellText: string);
    {$ENDIF}

and to repeat this where the events are implemented. Am I missing a simple solution? Thanks.

© Stack Overflow or respective owner

Related posts about tvirtualstringtree

Related posts about parameter-lists