Board index » delphi » Serios bug when closing windows???

Serios bug when closing windows???

bim...@ibm.net  (Per Bakkendorff) wrote:

Quote

> Hi all.

> Has anybody a _real_ solution for the following problem.

> When you have a delphi application running, and you are shutting down windows,
> (don't close your app first), NONE of your destructors are called!!!!

> I've developed two applications in delphi, and both customers reported back that
> data just entered were lost. (I use a desktop Paradox database). First I couldn't
> duplicate the error, but after some testing, I found that they were closing Windows
> without close my app first.

> The only solution I have found so far, are to close the tables in the event
> "QueryClose". This solved the problem with data loss, but this is _absolutely_ not
> the correct solution.

> Does Steve T. or K. from Borland have the correct solution for this problem???

> Any help greatly appreciated....

> regards

> Bimmer (Per Bakkendorff)

I had the same problem with an app I have been developing. 3 times
data was lost. I found that using a TDatabase object with an App
wide alias seems to cure the problem.

Maybe the TDatabase is more careful closing down than individual
TTables.

Don't know if this is a real cure but it seems to work.

 

Re:Serios bug when closing windows???


Quote
My Name <em...@haven.uniserve.com> writes:
> bim...@ibm.net  (Per Bakkendorff) wrote:

>> Hi all.

>> Has anybody a _real_ solution for the following problem.

>> When you have a delphi application running, and you are shutting down windows,
>> (don't close your app first), NONE of your destructors are called!!!!

>> I've developed two applications in delphi, and both customers reported back that
>> data just entered were lost. (I use a desktop Paradox database). First I couldn't
>> duplicate the error, but after some testing, I found that they were closing Windows
>> without close my app first.

>> The only solution I have found so far, are to close the tables in the event
>> "QueryClose". This solved the problem with data loss, but this is _absolutely_ not
>> the correct solution.

>> Does Steve T. or K. from Borland have the correct solution for this problem???

>> Any help greatly appreciated....

>> regards

>> Bimmer (Per Bakkendorff)

> I had the same problem with an app I have been developing. 3 times
> data was lost. I found that using a TDatabase object with an App
> wide alias seems to cure the problem.

> Maybe the TDatabase is more careful closing down than individual
> TTables.

> Don't know if this is a real cure but it seems to work.

Using OnCloseQuery _IS_ the currect thing to use.  OnClose will not activate
when windows is closing down.  Only OnCloseQuery is.  It is sufficient to put
the OnClose code in the OnCloseQuery and remove it from the OnClose, since
OnClose is no longer needed, since OnCloseQuery catches all events OnClose
catches plus windows shutdown.

This is WINDOWS, *NOT* Delphi.  VB does the same thing with its Unload and
UnloadQuery events.

Regards,
Don.

Other Threads