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.
access exception in TDBTree after dragging & dropping a node
-
- 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
Hi WolfDog,
Thanks in advance.
Does this occur with a standard 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.
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'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?
Sure, it could be a valid workaround to the issue.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?
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 |
Instructions - How to post in this forum |
Re: access exception in TDBTree after dragging & dropping a node
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.
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.
-
- 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
Hi WolfDog,
If that was the case that would mean a bug in your custom class.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.
Excellent, thanks.I will try to put together a simple project. I'm not sure how simple it can be, but I will try.
I'm sorry to hear that. I hope she is as best she can.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.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: access exception in TDBTree after dragging & dropping a node
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.
Thanks for your comments and support.