realbasic-nug
[Top] [All Lists]

Re: App Crashing Calling OpenPrinterDialog

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: App Crashing Calling OpenPrinterDialog
From: Kimball Larsen <kimball@kimballlarsen.com>
Date: Sat, 30 Aug 2008 12:40:42 -0600
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <792450A3-77F1-4D9F-969C-3FF885B158E6@mac.com>
References: <mailman.26.1220080089.20259.realbasic-nug@lists.realsoftware.com> <792450A3-77F1-4D9F-969C-3FF885B158E6@mac.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On Aug 30, 2008, at 1:16 AM, Sam Rowlands wrote:

Hi Kimball,
Congratulations on having a successful product. I don't know if these suggestions will help, but I thought I would suggest them anyway.

1) Check to make sure that the printersetup object is not nil before passing it to the printerdialog. If its Nil then create a new printersetup.

2) Check the printersetup's width and height, if they are 0 or less then create a new printersetup.

I am not sure where it happens or how it happens, but sometimes I have found that my printersetup becomes useless either by becoming nil or by having a width or height of 0 (or less).

I hope these help and wish you a great weekend.


Sam,

Thanks for the suggestion - I have attempted to make the call like this:

g = OpenPrinterDialog(new PrinterSetup)

It still fails.

I suppose the next step would be to see if the PrinterSetup constructor is returning an invalid or nil PrinterSetup object.


-- Kimball


On Aug 30, 2008, at 3:08 PM, realbasic-nug-request@lists.realsoftware.com wrote:

I have a userbase of several thousand users, on a mix of Win 2000, XP, Vista, and OS X 10.x. Most all of them print from my application on a
regular (daily) basis with no problems.

Yesterday I heard from a user on Vista who is having problems.  Big
problems:

When he hits the print button, the application crashes - so hard, in
fact, that no exception is ever even thrown. The app simply goes away.

I have very verbose logging installed in my app, and have narrowed the
crash down to this call:

 g = OpenPrinterDialog(app.pageSetup)

This is supposed to open the OS printer selection box where he can
choose which printer to use, how many copies to print, etc.

app.pageSetup is a printerSetup object that is setup like this:

app.pageSetup.setupString = pageSetupPref

where pageSetupPref is a string read out of my database (it is stored
in the database in a base64encoded format to avoid binary gunk in the
string wreaking havoc with stuff on windows - historically in RB apps
this has been a problem)

As I said above, this approach works fantastically well for my other
several thousand users - just not for this one. How can I narrow down
what is causing the problem?

Here is what I have tried:
Change the call to be g = OpenPrinterDialog(new PrinterSetup) - still
crashes  (this eliminates the possibility that the string is being
corrupted by being stored in the database)
Uninstall all printers, then install just a pdf printer - still crashes
Cleaned up registry entries related to printing, spooling, or old
printer software - still crashes
Dug around in the windows event viewer looking for information -
nothing to be found there.

Mahalo & Aloha,

Sam Rowlands


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>