LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Related to Printer selection and selecting one of them programatically

Hi ,
 
In my application I am using LW/CVI and my system is connected with more than one printer . Now I want to get Ids of all printers that are available and select one of them programatically for printing .Tell me what are the functions that can be used in this situation.
 
Regards
Subrata
0 Kudos
Message 1 of 4
(3,420 Views)
Subrata,

In order to specify a printer programmatically in CVI, you use the ATTR_PRINTER_NAME print attribute.

In order to browse the list of available printers, there is nothing in the standard CVI libraries that will allow you to do that. However, you can use the SDK function GetProfileString to return the list of installed printers. To do so, pass "PrinterPorts" as the first parameter, and NULL as the second parameter.

Luis
0 Kudos
Message 2 of 4
(3,411 Views)

Hi  Lous ,

 

            I havei ncluded  the function call Getprofilestring ("PrinterPorts" ,NULL); .It shows an error and that is   " Insufficient number of arguments to `GetProfileStringA'". What should I do next reply me soon ?

 

Regards

Subrata

0 Kudos
Message 3 of 4
(3,389 Views)

As well as the two parameters that Luis gave details for, there are three others that you need to supply as well. The prototype is as follows, but you should check out the SDK help for the function.

    DWORD GetProfileString (LPCTSTR lpAppName,
                            LPCTSTR lpKeyName,
                            LPCTSTR lpDefault,
                            LPTSTR lpReturnedString,
                            DWORD nSize);

JR

0 Kudos
Message 4 of 4
(3,384 Views)