LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the windows print dialog

I'm programming my application and want to let the user select the printer to be used. I found an example for labview, but when I use this in Labwindows/CVI the used structure and function are unknown. The type is defined in commdlg.h but because of some settings it is not available. Can somebody help me to make this work or tell me if there is another way to let the user select the preferred printer. I included windows.h (which include commdlg.h) and used the following calls:

{
HWND hwnd;

/* Defined in the Windows header files */
LPPRINTDLG lppd;

/* Get the handle to the main window. */
GetPanelAttribute (gMainPanel.handle, ATTR_SYSTEM_WINDOW_HANDLE, &hwnd);

lppd.lStructSize = sizeof(PRINTDLG); /* size of the structure
*/
lppd.hwndOwner = hwnd; /* dialog box's owner */
lppd.hDevMode = NULL; /* not needed */
lppd.hDevNames = NULL; /* not needed */
lppd.Flags = PD_PRINTSETUP; /* show the Print Setup dialog */

(void) PrintDlg(&lppd);
}
0 Kudos
Message 1 of 2
(3,027 Views)
PrintDlg is an SDK function. Make sure you have installed the SDK. Once this is done try adding "commdlg32.lib" to your project.

Steve
0 Kudos
Message 2 of 2
(3,027 Views)