I am in a situation where I need to have a user use a print dialog, save the
DevMode information from the dialog, then sometime later reload it and use
it.

For this, I save all the members of the structure, then copy the binary data
at the end ("Driver Extra") by copying the bytes from the end of the
structure for the length DevMode.dmDriverExtra.

This works almost all of the time. However, I have run across a couple of
print drivers (Xerox drivers) where this does not work.

It seems that perhaps the problematic drivers have driver extra data with
pointers to structures that later, on reload, don't exist. If this is the
case, then I suppose I'm hosed. Does anybody have any ideas what else might
be going on?

Thanks,
James

Re: Copying DevMode structure by edwardho

edwardho
Thu Jul 22 05:12:46 CDT 2004

Open that printer with its default devmode, and then call
DocumentProperties() with DM_IN_BUFFER|DM_OUT_BUFFER, using your saved
DEVMODE as input dm.

Also you can try ResetDC()...


"James" <jamesaspect@yahoo.com> wrote in message
news:<O8MO$m5bEHA.3944@tk2msftngp13.phx.gbl>...
> I am in a situation where I need to have a user use a print dialog, save the
> DevMode information from the dialog, then sometime later reload it and use
> it.
>
> For this, I save all the members of the structure, then copy the binary data
> at the end ("Driver Extra") by copying the bytes from the end of the
> structure for the length DevMode.dmDriverExtra.
>
> This works almost all of the time. However, I have run across a couple of
> print drivers (Xerox drivers) where this does not work.
>
> It seems that perhaps the problematic drivers have driver extra data with
> pointers to structures that later, on reload, don't exist. If this is the
> case, then I suppose I'm hosed. Does anybody have any ideas what else might
> be going on?
>
> Thanks,
> James

Re: Copying DevMode structure by Christoph

Christoph
Thu Jul 22 05:21:10 CDT 2004

Hi James,

For saving devmodes use DevMode.dmSize+DevMode.dmDriverExtra and copy the
whole block. The size of the public devmode part can differ between versions
of operating systems and the DDK versions used by the drivers.
Printer drivers must not rely on data extarnal to the driver extra data.

/christoph

"James" <jamesaspect@yahoo.com> wrote in message
news:O8MO$m5bEHA.3944@tk2msftngp13.phx.gbl...
> I am in a situation where I need to have a user use a print dialog, save
the
> DevMode information from the dialog, then sometime later reload it and use
> it.
>
> For this, I save all the members of the structure, then copy the binary
data
> at the end ("Driver Extra") by copying the bytes from the end of the
> structure for the length DevMode.dmDriverExtra.
>
> This works almost all of the time. However, I have run across a couple of
> print drivers (Xerox drivers) where this does not work.
>
> It seems that perhaps the problematic drivers have driver extra data with
> pointers to structures that later, on reload, don't exist. If this is the
> case, then I suppose I'm hosed. Does anybody have any ideas what else
might
> be going on?
>
> Thanks,
> James
>
>



Re: Copying DevMode structure by vipin

vipin
Thu Jul 22 09:40:17 CDT 2004

Hello,
DrvConvertDevmode takes care of cross platform DEVMODE issues, I
assume you meant NT3.5 based DEVMODE and later ones.
As you said the DEVMODE will be different across platforms but compatibilty
with the single driver code can be done thrugh this functin.

thanks
vipin


"Christoph Lindemann" <clindemann@newsgroups.nospam> wrote in message
news:#5nIdW9bEHA.2388@TK2MSFTNGP11.phx.gbl...
> Hi James,
>
> For saving devmodes use DevMode.dmSize+DevMode.dmDriverExtra and copy the
> whole block. The size of the public devmode part can differ between
versions
> of operating systems and the DDK versions used by the drivers.
> Printer drivers must not rely on data extarnal to the driver extra data.
>
> /christoph
>
> "James" <jamesaspect@yahoo.com> wrote in message
> news:O8MO$m5bEHA.3944@tk2msftngp13.phx.gbl...
> > I am in a situation where I need to have a user use a print dialog, save
> the
> > DevMode information from the dialog, then sometime later reload it and
use
> > it.
> >
> > For this, I save all the members of the structure, then copy the binary
> data
> > at the end ("Driver Extra") by copying the bytes from the end of the
> > structure for the length DevMode.dmDriverExtra.
> >
> > This works almost all of the time. However, I have run across a couple
of
> > print drivers (Xerox drivers) where this does not work.
> >
> > It seems that perhaps the problematic drivers have driver extra data
with
> > pointers to structures that later, on reload, don't exist. If this is
the
> > case, then I suppose I'm hosed. Does anybody have any ideas what else
> might
> > be going on?
> >
> > Thanks,
> > James
> >
> >
>
>



Re: Copying DevMode structure by Christoph

Christoph
Fri Jul 23 04:55:24 CDT 2004

Hi Vipin,

You are correct.

Best regards,
Christoph

"vipin" <vipin@nospam.com> wrote in message
news:u7iHPh$bEHA.2340@TK2MSFTNGP10.phx.gbl...
> Hello,
> DrvConvertDevmode takes care of cross platform DEVMODE issues,
I
> assume you meant NT3.5 based DEVMODE and later ones.
> As you said the DEVMODE will be different across platforms but
compatibilty
> with the single driver code can be done thrugh this functin.
>
> thanks
> vipin
>
>
> "Christoph Lindemann" <clindemann@newsgroups.nospam> wrote in message
> news:#5nIdW9bEHA.2388@TK2MSFTNGP11.phx.gbl...
> > Hi James,
> >
> > For saving devmodes use DevMode.dmSize+DevMode.dmDriverExtra and copy
the
> > whole block. The size of the public devmode part can differ between
> versions
> > of operating systems and the DDK versions used by the drivers.
> > Printer drivers must not rely on data extarnal to the driver extra data.
> >
> > /christoph
> >
> > "James" <jamesaspect@yahoo.com> wrote in message
> > news:O8MO$m5bEHA.3944@tk2msftngp13.phx.gbl...
> > > I am in a situation where I need to have a user use a print dialog,
save
> > the
> > > DevMode information from the dialog, then sometime later reload it and
> use
> > > it.
> > >
> > > For this, I save all the members of the structure, then copy the
binary
> > data
> > > at the end ("Driver Extra") by copying the bytes from the end of the
> > > structure for the length DevMode.dmDriverExtra.
> > >
> > > This works almost all of the time. However, I have run across a
couple
> of
> > > print drivers (Xerox drivers) where this does not work.
> > >
> > > It seems that perhaps the problematic drivers have driver extra data
> with
> > > pointers to structures that later, on reload, don't exist. If this is
> the
> > > case, then I suppose I'm hosed. Does anybody have any ideas what else
> > might
> > > be going on?
> > >
> > > Thanks,
> > > James
> > >
> > >
> >
> >
>
>