Skip to content

Drag & Drop range exception #682

@jfuentesbme

Description

@jfuentesbme

VirtualTrees.Pas, procedure TBaseVirtualTree.DragAndDrop, using windows 7. Parameter DragEffect has values that raises a range exception when the drag&drop operation implies scrolling in grid. The returned value of DragAndDrop should be casted to avoid range exception

procedure TBaseVirtualTree.DragAndDrop(AllowedEffects: Dword; const DataObject: IDataObject; var DragEffect: Integer);
var
lDragEffect: DWord; // required for type compatibility with SHDoDragDrop
begin
if IsWinVistaOrAbove then
begin
lDragEffect := DWord(DragEffect);
SHDoDragDrop(Self.Handle, DataObject, nil, AllowedEffects, lDragEffect); // supports drag hints on Windows Vista and later
DragEffect := Integer(lDragEffect); // ********* Cast Exception ******** // DragEffect := lDragEffect;
end
else
Winapi.ActiveX.DoDragDrop(DataObject, DragManager as IDropSource, AllowedEffects, DragEffect);
end;

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions