In my desktop application I save the user’s PrinterSetup.setupString in their preference file and load it back up when they open the Page Setup dialog. However, sometimes this string doesn’t seem to be valid (e.g., they migrate the preferences from one computer to another, the printer options are no longer available). In these instances my build crashes without an error, even in the debugger. Has anyone seen this or can you suggest a way to generate a error that I can catch?
In my experience, trying to save the printer setup between launches of your app is fraught with “gotchas”. I require my users to recreate the setup string with each new launch but can save it for multiple print jobs within the same app run. I also believe there was some issues with the printer setup on Windows previously. Don’t know if those issues have been fixed.
My post will serve to subscribe me to this topic so I can see, like you, if others have a way to catch printer setup errors.
Ive been having this problem for a long time now. Sometimes the app works fine and other times it crashes. Its very inconsistent and impossible to debug. It happens when the user clicks a pushbutton whose action checks the stored printer settings against the PageSetupDialog to see if the user changes the settings, if so, it uses the new settings, if not, it uses the stored settings.
When it DOES crash, its always when the user click that button… I tried putting a breakpoint on the first line in the action event but the app crashes without even getting to the action event.
Looking in the Application Event Viewer, it shows the faulting module to be the msvcr100.dll file.
I’m not real sure if it has anything to do with the printer settings/setup but it only happens when that button is clicked.
Saved printer setup strings should be local to the machine and user, not shared ever. If the printer is no longer valid when you restore the setup string, you will crash. And there’s really no way to prevent it.
You need to provide a mechanism to remove the saved setup.