View Single Post
  #1 (permalink)  
Old 02-05-2008, 11:16 AM
Andrew Kennard
 
Posts: n/a
Re: Changing a printers "global default" settings programatically on WinXP
Hi all

I've done a cross post on this reply tomyself(!) because I cant find an
appropriate group to post this on.

OK i've dug a bit futher an can confirm that when I use GetPrinter to get
the PRINT_INFO_2 data from the printer is the duple mode is set the correct
value is returned

If it is not set the I change the DevMode.dmDuplex value and then pass it
through DocumentProperties

Move
(DocumentProperties(0,hPrinter,AddressOf(sPrinterN ame),ppi2.pDevMode,ppi2.pDevMode,(DM_IN_BUFFER+DM_ OUT_BUFFER)))
to iFlag

When it comes out the other side of this dmDuplex is still set how I set it

I then call SetPrinter with the full PRINT_INFO_2 data and it returns non
zero ie succeeds

Move (SetPrinter(hPrinter,2,pPI2_Data,0)) to iFlag

BUT the duplex value when I go and check in the property panel of the
printer has not changed ????

Any help with this would be greatly appreciated !

Thanks

Andrew


"Andrew Kennard" <b@a.com> wrote in message
news:uK9izi1ZIHA.4172@TK2MSFTNGP02.phx.gbl...
> Hi all
>
> Further to my other post I've found some more info on printer settings
> specfically
>
> http://support.microsoft.com/kb/140285
>
> I've converted it so that it works in the language I am using (Visual
> Dataflex) and it appears to be working in that non of the functions return
> errors etc
>
> However having used it to "set" the duplex mode of the printer.
>
> When I go back into "Printers and Faxes" on XP and call up the printers
> properties this setting has not changed ?
>
> Should this have worked ? ie am I doing something wrong ?
>
> Or can it not be done this way and I need to use another method ?
>
> Thanks in advance for your help
>
> Andrew
>
> PS I couldn't seem to find an appropraite newsgroup to post this on so I
> hope these are the two closest !
>



Reply With Quote
Sponsored Links