access exception in TDBTree after dragging & dropping a node

TeeTree VCL for Borland Delphi and C++ Builder.
Post Reply
WolfDog
Newbie
Newbie
Posts: 4
Joined: Tue Mar 30, 2010 12:00 am

access exception in TDBTree after dragging & dropping a node

Post by WolfDog » 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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: access exception in TDBTree after dragging & dropping a node

Post by Narcís » Thu Jan 24, 2013 10:18 am

Hi WolfDog,
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.
Does this occur with a standard TDBTRee component?
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?
Difficult to tell, could you please attach a simple example project we can run "as-is" and let us know the steps we should follow to reproduce the problem here?
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?
Sure, it could be a valid workaround to the issue.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

WolfDog
Newbie
Newbie
Posts: 4
Joined: Tue Mar 30, 2010 12:00 am

Re: access exception in TDBTree after dragging & dropping a node

Post by WolfDog » Thu Jan 24, 2013 10:27 am

I don't think it happens with the normal TDBTree, but to be honest, I haven't worked with it without my custom code that much.

I will try to put together a simple project. I'm not sure how simple it can be, but I will try.

I am a caretaker for my mother who has Parkinson's and have obligations that are kind of unpredictable, so I can't say for sure how long it will be. Hopefully, very soon, but one never knows.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: access exception in TDBTree after dragging & dropping a node

Post by Narcís » Thu Jan 24, 2013 10:54 am

Hi WolfDog,
I don't think it happens with the normal TDBTree, but to be honest, I haven't worked with it without my custom code that much.
If that was the case that would mean a bug in your custom class.
I will try to put together a simple project. I'm not sure how simple it can be, but I will try.
Excellent, thanks.
I am a caretaker for my mother who has Parkinson's and have obligations that are kind of unpredictable, so I can't say for sure how long it will be. Hopefully, very soon, but one never knows.
I'm sorry to hear that. I hope she is as best she can.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

WolfDog
Newbie
Newbie
Posts: 4
Joined: Tue Mar 30, 2010 12:00 am

Re: access exception in TDBTree after dragging & dropping a node

Post by WolfDog » Sat Feb 16, 2013 6:08 am

I never really figured out what was happening, but I revised my code, using a much different approach, and the problem has gone away.

Thanks for your comments and support.

Post Reply