Common\\runprint.cpp Runtime Exception

Runtime Error on Windows 10 Home Ed. 64-bit. My application is 32-bit compiled with Xojo 2017 r1.

Common\runprint.cpp: 180
Failure Condition: returnGfx

I’ve just moved from Xojo 2016 r2.1 to 2017 r1. This error has only occurred when compiled with the latest version of Xojo. I thought it might be a declare that wasn’t targeted, but I have no declares in this project.

Does anyone have an idea of what this means and where I might look to correct it?

TIA-

–Chris

I had this error while I used pictures with wrong resolution in an Toolbar. Check that all of your used pictures have a resolution of 72 x 72 dpi.

Thank you, Horst-

I spent time today debugging my project with both Xojo 2017 r.1.1 and Xojo 2016 r2.1. My runtime error would only occur when going to print and only with Xojo 2017 r.1.1.

Xojo moved to Direct2D and DirectWrite as of v2106 r4. I suspect that this is why my project is having trouble. The prints that are successful with my app under 2017 r.1.1 are not formatted correctly either.

I found an open case regarding this, originally filed by Bob Keeney (https://xojo.com/issue/47630)]Case #47630

Sample code:

[code](Method: P as Picture)
Dim Printer as PrinterSetup=New PrinterSetup
Dim g as Graphics

Printer.SetupString=MyPrinterSetupString

g = openPrinter(Printer)

g.drawPicture p, (g.Width/2)-(p.Width/2),(g.Height/2)-(p.Height/2)[/code]

Eureka!
After a bit of testing and digging this weekend, I was able to find the cause of the problem and have the issue verified by the Xojo team.

The issue is caused by a Printer Setup String created/saved by a version of Xojo earlier than 2016 r4, which did not use Direct2D.

Reading the old Printer Setup String when using an app compiled with Xojo 2016 r4 or later causes the runtime error.

1 Like

Good catch!

Thanks, Bob- seeing your reported case was a big help!