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

Access violation when using run-time packages

edited June 2005 in General
Hi,

I'm with Delphi 7 Update Pack 1, ReportBuilder 9.02 clean install, Windows
XP. I've built my application with run-time packages.

Now, each time I try to save a Report template after editing it (using
ppDesigner), I get an Access Violation with rbRCL97.bpl. Read of 00000000. I
know it means it's trying to access a NIL pointer, but I don't know where
exactly. What I was trying to do is to add a OnDrawCommandClick in RAP
editor.

If I just try to save it without editing, I get an Access Violation on
rtl70.bpl...

I didn't change any ReportBuilder source, I did a clean reinstall. I tried
to rebuild without run-time packages, to be able to trace the source and it
seems to occur on the WriteToStream call...

David

Comments

  • edited June 2005
    I'm tracing it deeper and I found that FPrinterInfo isn't correctly fed.

    David


    "David Caouette" a ?crit dans le message de
  • edited June 2005
    FINALLY, I found it.

    Calling ppPrinters.Refresh prior to ppDesigner.ShowModal was causing the
    error... Now, my question is :

    WHEN should I call ppPrinters.Refresh ???

    David Caouette


    "David Caouette" a ?crit dans le message de
  • edited June 2005
    Hi David,

    Looking at the RefreshPrinters procedure, it looks as though it begins by
    freeing the uPrinter variable then clearing the existing printer list before
    reconstructing the list from scratch. If I were to guess, I would say
    ReportBuilder needs a valid reference to the uPrinter variable after the
    ShowModal event is fired. I would suggest experimenting with certain events
    to see if you can find the right time to safely make this call. After the
    template has been loaded or just before the report is printed would be a
    good place to start.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.