LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PrintDialog

I am using PrintTextFile(), but it has no option for selecting printer (PrintDialog). Currently I am using CVI 6.0. Does anyone know how to select printer in CVI (except of using PrintPanel or PrintCtrl) ?
Like a dialog box where the user can select printer ?
0 Kudos
Message 1 of 2
(2,993 Views)
Hi Peter,
You can change the default printer with CVI by using the SetPrintAttribute function and the attribute pasted below...

Constant: ATTR_PRINTER_NAME
Data Type: string (char *)
Description: This attribute specifies the printer to which output is sent. A NULL or empty string specifies the system's current printer.
If the specified printer does not exist, the system's current printer is used.
Valid for text printing and graphics printing.

However I don't know of a way to bring up a list of installed printers on a system and let the user select.. Maybe, if your list of printers is pretty static, you could create a list of available printers, and use some kind of popup to let the user select from them... This list could be maintained as some kind
of text file outside of the code to facilitate addition and removal of the printers...
Message 2 of 2
(2,993 Views)