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

Cannot pint, AccessViolation...

edited November 2004 in General
Hi,

I try to print to ArchiveFile, I have no printer installed.
An access violation is raised
in unit: ppDrwCmd
in function: function DetermineHeight(BWidth: Integer; var BHeight:
Integer): Boolean;

because ppPrinter is not assigned.
and try to GetPixelsPerInch.

function TppCustomPrinter.GetPixelsPerInch: TPoint;
begin

FLock.Acquire; //!! ACCESS VIOLATION WILL OCCOUR HERE !!//

try

{call GetDC which will create a DC and determine devcaps, if needed }
GetDC;

if FDC <> 0 then
Result := FPixelsPerInch
else
Result := Point(Screen.PixelsPerInch, Screen.PixelsPerInch);
finally
FLock.Release;
end;

end; {function, GetPixelsPerInch}

best regards

Ferenc Nemeth

Comments

  • edited November 2004
    Hi Ferenc,

    Which version of ReportBuilder are you using? This bug may have been
    addressed in a patch or update.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2004
    Ferenc

    Are you using XP Pro SP2?

    We had no problems with RB and other Word Processing products with no
    printer installed on XP untill we upgraded to XP SP2. After the upgrade
    unless there was a printer assigned we were getting access violations on a
    regular basis.

    XP SP2 seemed to have changed a number of features of printing.

    Hope this helps


  • edited November 2004
    Nico Cizik (Digital Metaphors) wrote:
    ReportBuilder Enterprise Edition
    Version 7.04
  • edited November 2004
    Hi,

    thank you, but I think it will not help.

    I am using XP with SP2. I have spent 2 days to solve this problem. You
    can meet this problem on a Win 2000 server, Win 2003 server or XP. If
    there is NO PRINTER INSTALLED, or the printer IS NOT READY, you will get
    this AV.

    I think if you use Barcode, then the above code will run, and raise an
    AV. because it uses TppCustomPrinter.GetPixelsPerInch.

    best regards
    Ferenc Nemeth
This discussion has been closed.