Цитата:
Сообщение от Kingcss
хм, честно говоря не понял ваш пост, вы могли бы объснить по проще...
|
У Вас написано
Код:
function TForm13.SortCaptionAsString(Item1, Item2: TListItem;
ParamSort: integer): integer;
begin
Result := 0;
if AnsiUpperCase( Item1.Caption ) > AnsiUpperCase( Item2.Caption ) then
Result := ParamSort
else
if AnsiUpperCase( Item1.Caption ) < AnsiUpperCase( Item2.Caption ) then
Result := -ParamSort;
end;
надо
предварительное объявление
Код:
function SortCaptionAsString(Param1, Param2: Pointer;
ParamSort: integer): integer; stdcall;
вынести из объявления типа TForm13 и описание
Код:
function SortCaptionAsString(Param1, Param2: Pointer;
ParamSort: integer): integer; stdcall;
var
Item1, Item2: TListItem;
begin
Item1:=TListItem(Param1);
Item2:=TListItem(Param2);
Result := 0;
if AnsiUpperCase( Item1.Caption ) > AnsiUpperCase( Item2.Caption ) then
Result := ParamSort
else
if AnsiUpperCase( Item1.Caption ) < AnsiUpperCase( Item2.Caption ) then
Result := -ParamSort;
end;
тоже без TForm13, и тогда в строке
Код:
ListView1.CustomSort( SortFirstSubItemAsString, Sort )
не надо будет использовать символ
@