
How I get the DriverName, PrinterName and PortName from the selected printer (hDC)?
Hi Seffen,
Using the VB's CommonDialog control the only way to get this info is to
set the PrinterDefault property to TRUE. This will make the printer
selected by the user to be the Default one and than you can get Port
Driver and Name from the Printer object.
If changing the default printer is not desirable you will have to call
the PrintDlg() API directly to display the Printer dialog instead of the
limitted VB's CommonControl control and then you can have the DEVMODE
structure containing all the printer's settings made by the user. Also
you could display the Printer Dialog initilized with data for any system
printer, not just the default one.
If you want code that implements the above e-mail me.
Regards,
Stoil
Quote:
> Hy,
> I use VB6 SP3 and the Printer-CommonDialog to get the Devicecontext (hDC)
> with the 'cdlPDReturnDC' Flag. Now I want to set the DriverName, PrinterName
> and PortName in the SelectPrinter-Methode from CrystalReports Version 7. But
> I do not know how to get the DriverName, PrinterName and PortName from the
> selected printer (to set the .PrinterDefault = true is not a possibility)?
> Thanks, Steffen
> ------------------------------
> Steffen Maurer
> Wiesbaden, Germany