Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SelectPrinter() to change printers?

78 views
Skip to first unread message

David Rowed

unread,
May 7, 1999, 3:00:00 AM5/7/99
to
I need to set the printer for an MFC print task without using the dialog
box.
I have the name of the printer for the particular task stored, and need to
use this rather than the MFC default, or just change the MFC default.
CWinApp::SelectPrinter( HANDLE hDevNames, HANDLE hDevMode, BOOL bFreeOld =
TRUE ) looks as though it should do the job, but setting up the HANDLE
hDevNames, HANDLE hDevMode doesn't seem straight forward, given that I only
want to set one variable----the printer name.

Thanks,


David.

David Lowndes

unread,
May 7, 1999, 3:00:00 AM5/7/99
to

David,

It is a bit long-winded. I think Knowledge Base article Q193103
"HOWTO: Implementing an Application-Defined Default Printer" shows you
the gory details.

Dave
----
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.

David Rowed

unread,
May 8, 1999, 3:00:00 AM5/8/99
to
Thanks, Dave.

I'll take a look there. If it's too gory I'll stop using MFC for printing as
it's always necessary for my program to select printers without the
operator. I'll go to my own CDC creation and Start/EndPage , print abort
dialog control which I've implemented elsewhere.

David.


David Lowndes <dav...@mvps.org> wrote in message
news:373a4476...@msnews.microsoft.com...

David Rowed

unread,
May 8, 1999, 3:00:00 AM5/8/99
to
Dave,

I can't find any KB article Q193103 on the Microsoft site. I've noticed Kb
articles being inaccessible before. do you know what that's all about?

David

David Lowndes

unread,
May 9, 1999, 3:00:00 AM5/9/99
to
>I can't find any KB article Q193103 on the Microsoft site. I've noticed Kb
>articles being inaccessible before. do you know what that's all about?

It does seem that there's often problems with the MS site. I just use
the MSDN CD myself.

0 new messages