首页  编辑  

ListView在XP下的一个AV BUG

Tags: /超级猛料/VCL/ListView/   Date Created:

 

...prevent your application from raising a AV with TListView under XP?

Author: Thomas Stutz  

{

 The TListView with a vsReport style causes an access violation

 when you run your project with a XP manifest resource.

 The VCL wrapper has a bug and you must patch sources.

 Just copy the comctrls.pas unit in the folder with your own

 project and modify the UpdateColumn method.

 After compiling the project, a comctrls.dcu is created

 and you can replace the original comctrls.dcu with the

 patched one.

}

// ComCtrls.pas:

procedure TCustomListView.UpdateColumn(AnIndex: Integer);

{...}

with Column, Columns.Items[AnIndex] do

begin

 { PATCH start:}

 // mask := LVCF_TEXT or LVCF_FMT or LVCF_IMAGE;

 mask := LVCF_TEXT or LVCF_FMT;

 if FImageIndex >= 0 then

   mask := mask or LVCF_IMAGE;

 { PATCH :end }

 {...}

end;