Software Archive
Read-only legacy content

printing

Intel_C_Intel
Employee
320 Views
If I use PRINTDLG to select a printer, how can I capture the printer name so I can use it in an OPEN statement?
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
320 Views
You can capture printer name:...
TYPE(T_DEVMODE):: DM; POINTER(pDM, DM) 
CHARACTER(32):: szPrinter 
TYPE(T_PRINTDLG):: PD 
 
!Initialize PD here... 
IF (PrintDlg(PD)) THEN 
    pDM = GlobalLock(PD%hDevMode) 
    szPrinter = DM%dmDeviceName 
    szPrinter = szPrinter(1 : INDEX(szPrinter, CHAR(0))-1) 
   ... 
... but you can't use it in an OPEN statement. The best you can get with Fortran RTL is to OPEN(...FILE="PRN"), but that will always print to the default printer. What kind of output do you want to print?
0 Kudos
Reply