Re: setPrintJobProperty problem

new topic     » goto parent     » topic index » view thread      » older message » newer message

CChris wrote:
> 
> Judith Evans wrote:
> > 
> > CChris wrote:
> > > 
> > > Andy Drummond wrote:
> > > > 
> > > > Back to printing problems.
> > > > I can open the default printer and print to it with no worries.
> > > > I had to declare printerDC to be global in w32Resources.ew, that was OK.
> > > > I'm now trying to change the print orientation using:
> > > > 
> > > >   setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> > > > 
> > > 
> > > This just works for me, using a laser printer under WinXP Home. Strange...
> > > Try
> > > calling it before getPrinter() perhaps.
> > > 
> > > CChris
> > > 
> > > > but I get no change in the output.
> > > > Can anyone advise me on this? I tried calling the function immediately
> > > > after
> > > > assigning printerDC, and also after calling startDoc & startPage; still
> > > > no
> > > > go.
> > > > If I still have to go to printer setup to do this then I might as well
> > > > not be
> > > > opening the default printer....
> > > > 
> > > > AndyD
> > 
> > CChris, it would be nice if we didn't have to OK the Print screen as well as
> > the print setup screen. I'd like to be able to run a program which uses
> > getPrinter
> > and VOID=setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE) and have
> > the
> > printer start printing my document in landscape without interaction on my
> > part.
> 
> See the code I recently posted for a getDefaultPrinter() function; doesn't it
> do the job?
> 
> CChris

CChris,
I think the trouble is that when you use getPrinter() to choose a printer,
the code does more than just get a DC for the printer. I think it must load
up a parameter block for it. So if I call getPrinter() and just click OK, the
orientation control works fine. But if I use getDefaultPrinter() which gets
the DC of the default printer, it does NOT do the same parameter getting &
setting. Then the orientation control does nothing.  

I have replaced getDefaultPrinter() with getPrinter() and just clicked OK,
and it is fine. Remove that and it is not.

I haven't looked at the getPrinter() code (well, I have, but the stuff just
went in one eye and out the other) so I may be talking garbage; it wouldn't
be the first time. But that seems to be the logical conclusion. Is it?

If so, should you add the getDefault Printer() to Win32Lib then I assume it
would set things up exactly the same as getPrinter()+OK does. Then it will
work fine. I can wait; it is not a great pain like the press shift once pain.

Is it possible to call getPrinter() with an argument which tells the routine
the printer name to get or even just to imitate the press of OK for the
default printer? Something like (DOS days) pushing a keypress onto the key
stack before calling a routine which then gets the keypress & returns with
no user input needed. A thought....

I appreciate your work on Win32Lib enormously - as I do Derek's work and
I guess David Cuny's, who started it. You guys all want medals - or money -
but not being Bill Gates's, you will get users complaining their model railway
won't work right under Win32Lib or their printer keeps running out of ink or
something silly like that.  

Tough life, isn't it. You do have many fans, though!

AndyD

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu