I tested TVirtualStringTree (version 4.8.7) by Mike Lischke on Delphi 7.0 Windows XP 2. It works fine. I installed the same TVirtualStringTree (v.4.8.7) on another machine (Delphi 7.0 Windows XP 3 system) and tested that same project on the Windows XP 3 system. When I clicked the header, it prompted an error. I removed the TVirtualStringTree (version 4.8.7) from Delphi 7.0 Windows XP 3 and installed a higher version TVirtualStringTree (Version 5.3.0) on Windows XP 3. The same problem still existed.
When I built the project on Windows XP 3, it prompted below:
The vtHeaderClick method referenced by vt.Onheaderclick has an incompatible parameter list. Remove the reference?
I clicked No and run the test program. When I clicked the header, it prompted " Access violation at..."
And it prompted the error below:
function TVTHeader.HandleMessage(var Message: TMessage): Boolean;
// The header gets here the opportunity to handle certain messages before they reach the tree. This is important
// because the tree needs to handle various non-client area messages for the header as well as some dragging/tracking
// events.
// By returning True the message will not be handled further, otherwise the message is then dispatched
// to the proper message handlers.
var
P: TPoint;
R: TRect;
I: TColumnIndex;
OldPosition: Integer;
HitIndex: TColumnIndex;
NewCursor: HCURSOR;
Button: TMouseButton;
Menu: TPopupMenu;
IsInHeader,
IsHSplitterHit,
IsVSplitterHit: Boolean;
//--------------- local function --------------------------------------------
function HSPlitterHit: Boolean;
var
NextCol: TColumnIndex;
......
......
case Message.Msg of
WM_LBUTTONUP:
with TWMLButtonUp(Message) do
begin
if FColumns.FDownIndex > NoColumn then
FColumns.HandleClick(Point(XPos, YPos), mbLeft, False, False);
if FStates <> [] then // this line is highlighted
FOwner.DoHeaderMouseUp(mbLeft, KeysToShiftState(Keys), XPos, YPos);
end;
WM_NCLBUTTONUP:
with TWMNCLButtonUp(Message) do
begin
......
......
How can I solve this?