BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

odd D8/VCL.NET/IDE related problem - system.nullreferenceexc

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi IDE
View previous topic :: View next topic  
Author Message
Robert Toeplitz
Guest





PostPosted: Fri May 07, 2004 4:58 pm    Post subject: odd D8/VCL.NET/IDE related problem - system.nullreferenceexc Reply with quote



Dear Gentlemen,

migrating from a Delphi 6 VCL application to a VCL.NET application I
bumped into a weird error, which was kind of hard to trace back and found it
impossible to resolve so hereby I turn to you all.

After some debugging and tinkering I could finally break down the problem to
the following scenario. This scenario mimicks a minimal subset of my future
VCL.NET migrated application's behaviour:

- Create a new VCL.NET forms application.
- On the default Form1 lay a TDatabase component and two TButton components.
For this example let's name them Database1, OpenButton and CloseButton. The
buttons' onclick events should do no more than <Database1.Open> and
<Database1.Close> respectively. Database1 should point to a living database
source, altho the underlying database-type is totally irrelevant (have
tested with local postgresql, remote postgresql, dbase and excel
datasource -- all produced the same error).
- Put a TDatasource and a TTable component on the form too. TDatasource
pointing to TTable and TTable pointing to Database1. Pick any of your
database's tables for the TTable.
- Given just these components I've described, compile and run the
application. Everything works just fine. Clicking the buttons in any order,
closing the form at any time and doing these activities in any combination
should not bring up any error.
- Now comes the oddness. What makes things all messed up is putting a
TDBEdit component on the form. It doesn't even have to point the
TDatasource! Compiling and running the application is still OK but if I open
the database and close the form without explicitly choosing to close the
database before, it creates a System.NullReferenceException. I found out
that the exception is thrown in Borland.VCL.DBTables' finalize section when
calling FreeTimer. The guilty party is FreeTimer's <if Assigned(DBScreen)
then DBScreen.Cursor := dcrDefault;> line.

Agan. Opening the Form then opening the database with OpenButton then
closing it with CloseButton and then closing the form still works fine. But
even putting Database1.Close; in the form's onClose or onCloseQuery event
methods won't even help.

Even more weird is that removing the TDBEdit from the form leaves things as
messed up as they were.

The nullpointerexception is not thrown when doing the same actions outside
the IDE, but during development it is kind of annoying because any time I'm
not quick enough to stop execution before the exception is thrown, the IDE
start's throwing arbitrary exceptions at different times which leads to the
necessity of restarting it.

I've tested this behaviour on 2 different computers (one of them had nothing
else installed just delphi 8 and it's prerequisites) each with Delphi 8
update #2 and on a third one, which didn't have the updates just Delphi 8.
All three tests represented the exact same bug.

Has anybody bumped into the same problem or anything that could be related
to it? Does anybody have a fix or workaround for it?
I couldn't find any.

Thanks in advance,
Robert Toeplitz,
Hungary.


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi IDE All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.