The Delphi Bug List

Entry No.
569
External
Delphi 4's IDE crashes when using QuickReport components on a Win98 PC with a LaserJet 1100 printer
1.02 2.01 3.0 3.01 3.02 4.0 4.01 4.02 4.03 5.0 5.01 6.0 6.01 6.02 Kylix 1.0
N/AUnknownUnknownUnknownUnknownUnknownUnknownUnknownGotchaUnknownUnknownUnknownUnknownUnknownUnknown
Description
Reported by Lorenzo Mengoni; checked by Christopher Miller
I've installed Delphi 4 Professional on a Pentium Celeron 333 Mhz with Win 98 and a LaserJet 1100 as default printer. When I put on a blank form a TQuickReport component, the IDE crashes immediately, with an unrecoverable exception error in delphi32.exe module; if I set another printer as default, all is working properly.

Could please someone help me? :-(

Christopher Miller commented to this (22 Dec 99):
I have some additional information for this bug.
QuSoft is aware of the problem and is working on it for the QuickReport 3.0.6 release. The problem appears to be a timing issue with the HP drivers for the 1100, 2100, 4000, and 8000 family of printers. Using older drivers, such as the HP 4L driver, will not have the problem on the affected printers.

User-contributed comments
Elaine Coyle
03 Apr 2001  11:05 AM GMT
I have the same problem with Delphi 3 on Windows 2000. Defining a laserjet III as the default printer seems to solve the crashing and spurious access errors when running the executable.

Is an upgrade to Qreports available yet ?
Dimonka
11 Oct 2001  01:53 PM GMT
This also happens with Delphi 5.
I've found a solution for it. I'm not sure - what is the reason for such crash (drivers or Delphi). So:


Text "Printers.pas" about from 640-th line, look at the changes.
...
    J := FPrinters.Count;
    FPrinters.AddObject(Format(SDeviceOnPort, [ADevice, APort]),
      TPrinterDevice.Create(ADriver, ADevice, APort));
  end;
  FPrinterIndex := J;
  if OpenPrinter(ADevice, FPrinterHandle, nil) then
  begin
    if DeviceMode = 0 then  // alloc new device mode block if one was not passed in
    begin
      DeviceMode := GlobalAlloc(GHND,$600); // <----CHANGES HERE !!!!!! ====//
     {DocumentProperties(0, FPrinterHandle, ADevice, StubDevMode,//<-- HERE !!!!!! 
        StubDevMode, 0));} 	// <----AND HERE !!!!!! ===========//
      if DeviceMode <> 0 then
      begin
        DevMode := GlobalLock(DeviceMode);
        if DocumentProperties(0, FPrinterHandle, ADevice, DevMode^,
          DevMode^, DM_OUT_BUFFER) < 0 then
        begin
          GlobalUnlock(DeviceMode);
          GlobalFree(DeviceMode);
          DeviceMode := 0;
        end
      end;
    end;


It is not an optimal solution, but it is works...
Dimonka
11 Oct 2001  02:00 PM GMT
And another way.
(Checked only for Delphi 5)
You can find the code in your compiled program:
FF 50 8D 85 54 FF FF FF 50 8B
from the first byte (FF) goto 7 bytes before and write:
B8 00 06 00 00 EB 18
---------------
You'll get the same result. It will work (but not with Delphi32.exe...).
Best regards.
Dimonka.
Dimonka@nm.ru
Jarek Zgoda
22 May 2002  10:30 AM GMT
This is caused by HP LJ1100 drivers. Get updated drivers from HP pages.
Latest update of this entry: 2000-01-06

Post a comment on this bug


Index page
Delphi Bug List home page
The Delphi Bug Lists are presently maintained by Jordan Russell, who has taken over this task from Reinier Sterkenburg since August 2000.
All feedback is appreciated. See also the feedback section of the Delphi Bug List home page.