Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic creation/free'ing of QuickReports

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I have an application written in Delphi 5 that makes use of standard QuickReports. I am creating them on the fly using something like 'ReportQR := TReportQR.Create(Self)' and then calling 'ReportQR.Free' and setting 'ReportQR := Nil' after use.
This has seemed to work OK up til now but I have just develioped a problem with it - its OK the first five or six times but then creates a problem causing an access violation indicating that the component 'ReportQR' already exists.
Anyone suggest the problem and a solution ?
Steve
 
Are you using try and finally in your code?, because without it, if you have an exeption somewhere in the middle, 'ReportQR.Free' will not be executed.

Regards S. van Els
SAvanEls@cq-link.sr
 
I failed to mention the use of TRY ... FINALLY but it was indeed in place.
Following the problem I rebuilt the application (not changing code at all) and the problem seemed to resolve itself.
Which begs the question how frequent are troublesome builds like these and how can they be avoided (in case I miss one like this in future) ??
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top