12-27-2011 11:08 AM
I have a legacy application in C++, now ported to VS 2010. All works fine, except I get an intermittent error. I'm printing a CNiReport to a pdf printer (Win2Pdf). Every so often I get an error dialog pop up with the message "failed to get printer information" and the print fails (no pdf produced). This comes from the CnIReport::Print. Unfortunately I'm trying to run my program unattended and this dialog hangs waiting to be dismissed. If I dismiss the dialog and let the program continue, it does and then may or may not get the same error on the next Print. It fails both if I pass the printer name to Print and if I pass an empty name to make it use the default printer.
Can someone from NI confirm that the dialog is coming from CNiReport::Print and is there anything I can do to stop it? Also, why would it happen only occasionally?
Thanks
12-28-2011 11:57 AM
Hey Phil,
Could you post a screen shot of the error dialog?
It is uncharacteristic of NI software to have an error cause a dialog to popup. Typically an error code is returned passed and dealt with in error handling or the execution (compiling, run, etc) failing. so I am inclined to say this error is associated with the printer driver.
Luke W
12-28-2011 12:03 PM
Just wanted someone from NI to confirm that the message actually comes from NI software - a quick scan of the source code should do that.
The dialog box says "Failed to get printer information".
Thanks
12-29-2011 03:58 PM
Phil, I sent you a private message regarding this issue. This error may be generated by our code, and I want to work with you offline to see if we can resolve it.