access exception in TDBTree after dragging & dropping a node
Posted: Tue Jan 22, 2013 2:34 pm
Hi.
I have been working with your TeeTree ver 8 in C++Builder 2010 and am throwing an access exception in Controls.pas (attempt to read address 00000000) when I drop after dragging a node in the TDBTree component.
Actually, it is a component I derived from TDBTree, and I have DragAndDrop Automatic set to false and DragMode set to dmManualas I need to handle it myself in my own code.
I really can't get around this because I have to do some special handling.
The error is not coming from TDBTree, but from controls.pas, i.e., C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\source\Win32\vcl\contols.pas
line 4424:
DragCursor := TDragObject(DragObject).GetDragCursor(DoDragOver(dmDragMove),
Pos.X, Pos.Y);
I have tried for quite a while to figure it out, but without any luck.
I'm thinking because I am removing and adding nodes to the TDBTree manually, that this is causing the trouble, i.e., maybe it is trying to access one of the now invalid pointers to one of the removed nodes?
I started out using the TDBTree, since it is a database application, but I'm wondering if that was a mistake? If I switched to the TTree component and then just manually created the nodes based on the data in my own code, is it conceivable that that might help solve the problem?
Or if you have any other ideas what may be causing this or what I should look for, I would really appreciate it.
Thanks.
I have been working with your TeeTree ver 8 in C++Builder 2010 and am throwing an access exception in Controls.pas (attempt to read address 00000000) when I drop after dragging a node in the TDBTree component.
Actually, it is a component I derived from TDBTree, and I have DragAndDrop Automatic set to false and DragMode set to dmManualas I need to handle it myself in my own code.
I really can't get around this because I have to do some special handling.
The error is not coming from TDBTree, but from controls.pas, i.e., C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\source\Win32\vcl\contols.pas
line 4424:
DragCursor := TDragObject(DragObject).GetDragCursor(DoDragOver(dmDragMove),
Pos.X, Pos.Y);
I have tried for quite a while to figure it out, but without any luck.
I'm thinking because I am removing and adding nodes to the TDBTree manually, that this is causing the trouble, i.e., maybe it is trying to access one of the now invalid pointers to one of the removed nodes?
I started out using the TDBTree, since it is a database application, but I'm wondering if that was a mistake? If I switched to the TTree component and then just manually created the nodes based on the data in my own code, is it conceivable that that might help solve the problem?
Or if you have any other ideas what may be causing this or what I should look for, I would really appreciate it.
Thanks.