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

Refresh printerlist results in an Access Violation

edited August 2007 in End User
Hello

When I do a refresh of printerlist, by calling ppPrinters.Refresh and then
set a printername in the printersetup of the printerdevice (which is locally
created) by calling the statement:
lPrinterDevice.Printer.PrinterSetup.PrinterName := aPrintername result this
action in an Access Violation. This happens not always, but too many times.

When I don't refresh the printerlist the Access Violation doesn't occurs.
Refreshing the printerlist is nescessary to select the correct printer,
especially when we work under Citrix.

This Access Violation results in the situation that the label(s) we want to
print, are not printed. This can lead to dangerus situations. The label(s)
are nescessary for the process by our customers.

The question is how can I solve this Access Violation.

Regards
H. Willems
Software Engineer
iSOFT Nederland B.V.

Comments

  • edited August 2007
    Hi,

    Which version of ReportBuilder and Delphi are you using? Does this occur
    when printing to any printer. If you set your library path to
    \RBuilder\Source and set Delphi to stop on exceptions, are you able to
    determine where in the RB source the problem is occuring? Are you able to
    recreate the issue in a simple example I could run on my machine? If so,
    please send it to support@digital-metaphors.com in .zip format.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2007
    - for future reference, please post to an appropriate newsgroup. This
    question should have been posted to the devices newsgroup (if you cannot
    determine which group, then post to general.) There is description of the
    purpose of each newsgroup here.

    http://www.digital-metaphors.com/support/newsgroups.html

    - for future reference, please specify Delphi version, RB version (check the
    Help | About), Windows version (or in this case, Citrix environment).

    - If you are not using RB 10.06, which is the latest release, then try
    downloading a trial version and perform the same test.

    - try testing the code in a standard Windows environment (i.e. no Citrix).
    Citrix is supposed to seamlessly support Windows apps, but in reality it
    sometimes does not work like that.

    - If you can create a reproduceable test case on your developement machine,
    then try adding RBuilder\Source to the Delphi library path and configure the
    Delphi debugger to break on language exceptions. Run the project and when
    the AV occurs, examine the call stack.

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited August 2007
    Hi

    The version of ReportBuilder the customers currently using is 7.02 and on my
    development PC I'm using ReportBuilder 10.06. Both with Delphi 7. I can
    reproduce the error on my development PC. In a Windows environment.

    The Delphi option stop on exceptions is enabled, but Delphi doesn't stop at
    the point where the exception occurs.

    Regards
    H. Willems
    Software Engineer
    iSOFT Nederland B.V.

  • edited August 2007
    Hi

    A small addition to my previous post.

    When I moved the statement ppPrinters.Refresh just before the create of
    lPrinterDevice then the Access Violation doesn't occurs. Maybe is this
    modification in the software the solution for this problem. For the moment
    the problem looks solved, but I'm not really sure of it. Maybe I reintroduce
    some other problems with switching the default Windows printer.

    regard
    H. Willems


  • edited August 2007
    Hi,

    Thanks for the update. If you continue to have problems, please send a
    small example that demonstrates the issue to support@digital-metaphors.com
    in .zip format and we'll take a look at it for you.

    --
    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.