Strange crash
I have an application that displays a dialog box. The user selects an
option in the dialog and then I open a form, displaying data filtered based
on what the user selected. Upon closing the form, I ask the user if they
want to do it again, and if so, the dialog is displayed again and they can
display the data based on another filter.
While this form is open, the user can print reports. I have a form with a
bunch of reports on it which is created if the user clicks the print
button. The reports are printed and then the form with the reports on it is
closed (and freed).
The problem is that after printing reports, if the user wants to display
the form with the filtered data again, I get an AV when the form with the
data opens. When I search on the error location it's deep within the heart
of the delphi source and there's nothing meaningful in the call stack.
I'm at a complete loss to explain why this is happening, but I am wondering
if some reportbuilder stuff didn't get properly freed or something. Any
pointers about how to track down the cause of the problem would be greatly
appreciated.
option in the dialog and then I open a form, displaying data filtered based
on what the user selected. Upon closing the form, I ask the user if they
want to do it again, and if so, the dialog is displayed again and they can
display the data based on another filter.
While this form is open, the user can print reports. I have a form with a
bunch of reports on it which is created if the user clicks the print
button. The reports are printed and then the form with the reports on it is
closed (and freed).
The problem is that after printing reports, if the user wants to display
the form with the filtered data again, I get an AV when the form with the
data opens. When I search on the error location it's deep within the heart
of the delphi source and there's nothing meaningful in the call stack.
I'm at a complete loss to explain why this is happening, but I am wondering
if some reportbuilder stuff didn't get properly freed or something. Any
pointers about how to track down the cause of the problem would be greatly
appreciated.
This discussion has been closed.
Comments
firstly try to fine the line of your own code that throws the exception.
regards,
Chris Ueberall;
Thank you for your reply.
I am sorry if I came off as being so naive as to not have tried this first!
In fact *none* of my own code is in the call stack.
Given this do you have any suggestions?
at least 'Application.Run' should be on the call stack.
I'm pretty shure there is either a line of code from you from where the problem starts (e.g. Report.Print) or any other doing.
You wrote ' if the user wants to display
the form with the filtered data again, I get an AV when the form with the
data opens', show us this code.
You have the possibility to change your library path to ReportBuilder's source directory, Borland's code could be traced by adding the debug DCUs.
regards,
Chris Ueberall,
Thank you for your continued assistance.
set a breakpoint into method 'FormCreate' and step through the code to find the occasional line.
HTH,
Chris Ueberall;
Thanks again for your help. I was away on vacation which is why I didn't
get back to you earlier.
I spent quite some time stepping through the source -- and into the
Delphi source following it -- of the FormCreate event handler and didn't
find anything glaringly wrong, and the exception occurred after executing
many lines of code, and in the middle of some assembly code.
Anyway, I suddenly had this idea that perhaps the form was being closed
with a record unposted, and then the filter was reset to something that
would exclude this record, and that perhaps that was the cause of the
problem. I added a line of code to post the unposted record before
printing the reports, and now I can open the form as many times as I want
-- after printing reports, and it seems to work fine.
Guess I was barking up the wrong tree. I can tell you this is a real load
off my mind
Maggie;
I'm glad to see you solved your problem!
regards,
Chris Ueberall;