我在 Delphi 7.0 Windows XP 2 上测试了 Mike Lischke 的 TVirtualStringTree(版本 4.8.7)。它运行良好。我在另一台机器(Delphi 7.0 Windows XP 3 系统)上安装了相同的 TVirtualStringTree (v.4.8.7),并在 Windows XP 3 系统上测试了相同的项目。当我单击标题时,它提示错误。我从 Delphi 7.0 Windows XP 3 中删除了 TVirtualStringTree(版本 4.8.7),并在 Windows XP 3 上安装了更高版本的 TVirtualStringTree(版本 5.3.0)。同样的问题仍然存在。
当我在 Windows XP 3 上构建项目时,它提示如下:
The vtHeaderClick method referenced by vt.Onheaderclick has an incompatible parameter list. Remove the reference?
我单击“否”并运行测试程序。当我单击标题时,它提示“访问冲突在...”
它提示了以下错误:
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
......
......
我该如何解决这个问题?