Friday, October 13, 2006

Printer and the CommonDialog

In VB6, in order for you to make the Printer object in VB6 recognize the return of the CommonDialog.ShowPrinter method, you have to set something like:

Printer.TrackDefault = True
' then show the printer dialog
commonDialog1.ShowPrinter

The only problem here is that the commonDialog.DefaultPrinter is set to True by default. Thus, it practically sets the default printer to the selected. Any subsequent calls to the Printer object follow the printer selected in the Printer Dialog Box. Essentially you are setting a default printer via the dialog.

I have yet to find a way to retrieve the hDC (printer device handle) from the CommonDialog Print dialog such that it can be passed to the Printer object--if it indeed is possible. Because right now, I don't think this is the most efficient way to do it.

Labels: ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home