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 */
PRINTDLG 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,150 Views)
Hello,

you must have installed the SDK. In the SDK help, yoy'll find all the informations. You have to use the comdlg32.lib (adds it into your projetc, this file allows you to use the dll comdlg32 ).
0 Kudos
Message 2 of 2
(3,150 Views)