Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

failed to get printer information

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

Phil reaston
0 Kudos
Message 1 of 4
(5,972 Views)

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

0 Kudos
Message 2 of 4
(5,965 Views)

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

Phil reaston
0 Kudos
Message 3 of 4
(5,962 Views)

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.

National Instruments
0 Kudos
Message 4 of 4
(5,953 Views)