Bug Report T595258
Visible to All Users

An AV occurs on an attempt to retrieve settings of a disabled network printer in certain cases

created 7 years ago

--dxPrnPg.pas

procedure TdxPrinterPage.ApplyToPrintDevice;
var
  APaperInfo: TdxPaperInfo;
begin
  if dxPrnDev.dxInitPrintDevice(False) then
  begin
    dxPrnDev.dxPrintDevice.ColorMode := not GrayShading;
    dxPrnDev.dxPrintDevice.Orientation := Orientation;
    dxPrnDev.dxPrintDevice.SelectPaper(DMPaper);
    if DMPaper >= DMPAPER_USER then
    begin
      APaperInfo := TdxPaperInfo(dxPrnDev.dxPrintDevice.Papers.Objects[dxPrnDev.dxPrintDevice.PaperIndex]); //AV Code
      APaperInfo.Width := PageSizeLoMetric.X;
      APaperInfo.Height := PageSizeLoMetric.Y;
    end;
    dxPrnDev.dxPrintDevice.SelectBin(PaperSource);
  end;
end;

Hello.

I am getting access violation when creating TForm that includes a TdkxGridDBBandedTableView  - That is if the Default Printer is invalid (network printer not found on server) on my machine. The bold source-code line above is the one that throws the AV error.

Best Regards
Johann

Show previous comments (18)
D D
Dr. Michael Trubetskov 6 years ago

    Hi Paulo,

    One more update: I just received one more bug report from completely different customer with the same stack trace. In this case the software was compiled with v. 17.2.8. OS is "Windows 7 x64 Service Pack 1 build 7601".

    It is interesting to admit that this issue started to appear just recently. Maybe some Microsoft update changed the way how the printers are managed?

    The issue looks not reproducible with VMWare and unfortunately I have no devices with Windows 7 around. Later I will try to experiment with Windows 10 notebooks.

    Best regards,
       Michael

    VK VK
    Vasyl Kovalisko 6 years ago

      Hello, Paulo.

      Sorry for this delay of response. Finally I found time to try this fix.

      This modification of dxInitPrintDevice function in the dxPrnDev.pas unit made a fix for this exception.

      After applying this codeResult := (dxPrintDevice.Printers.Count > 0) and (dxPrintDevice.Handle <> 0) and (dxPrintDevice.DeviceMode <> nil);no issue anymore.

      Can we expect to get this fix in next release?

      DevExpress Support Team 6 years ago

        Thanks, Vasyl. Yes. We are planning to integrate this patch into our future builds (18.1.9 and 18.2.5).

        Answers approved by DevExpress Support

        created 6 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.