Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

SetReportProperty causing "Invalid Pointer Operations"

edited February 2007 in General
Hello,

I would like to thank Nico for his help in previous problems. This one,
seems tougher.

Using D7. The program sets a report property at run-time. This is because
the same report is shared by two apps. It was built in the other app, and I
have instuctions to not change a single line unless necessary. So, building
on what was done in the prior version of this software, I am linking to the
report with:

sbrElev.SetReportProperty([shared report name]);

If I leave this line intact (as it used to be), then when shutting down the
form that calls the report, I get an invalid pointer operation. Debug DCUs
show this is happening in system.pas in the _freemem routine. Specifically,

result:= MemoryManager.freemem(p);
if result <> 0 then
error(reInvalidPointerOp);

The program seems to be trying to free memory that is already freed or was
never allocated. I also get an AV when shutting down the whole program. If
I comment out the SetReportProperty line, then the form closes just fine and
the program exits without a whimper. Which makes me think that whatever is
causing the problem comes form the SetReport method. Stepping through the
call stack takes forever. As far as I can tell, all code relevant to the
shared report is copied over. Any ideas on what might be attempting to free
twice or not yet allocated memory? Or is more information required from me?

Comments

This discussion has been closed.