我在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)。同樣的問題仍然存在。如何解決這個TVirtualStringTree Onheaderclick不兼容的參數?
當我建立這個項目在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
......
......
我怎樣才能解決這個問題?
非常感謝。你的答案解決了它。 – warren 2015-02-09 09:02:30