PageSetupDlg and PSD_RETURNDEFAULT 
Author Message
 PageSetupDlg and PSD_RETURNDEFAULT

I don't know if this is the group to ask, but here goes:

I am attempting to access the printer defaults before any printing or
previewing.  With code something like:

     PAGESETUPDLG psd;

     ZeroMemory(&psd,sizeof(PAGESETUPDLG));
     psd.lStructSize=sizeof(PAGESETUPDLG);
     psd.Flags=PSD_RETURNDEFAULT;
     if (PageSetupDlg(&psd))
     {
          ...
     }

 the psd structure seems to be filled appropriately, but the hDevMode
member does not point to anything sensible.  Casting that hDevMode to a
DEVMODE pointer does not work.  How can I access hDevMode?  And, if this
is the wrong group to ask, I'd appreciate a tip on which one would be
helpful.

Thanks.

Charlie Brown



Sun, 03 Dec 2000 03:00:00 GMT  
 PageSetupDlg and PSD_RETURNDEFAULT

On Wed, 17 Jun 1998 15:24:39 -0400, Charlie Brown

Quote:

>I don't know if this is the group to ask, but here goes:

>I am attempting to access the printer defaults before any printing or
>previewing.  With code something like:

>     PAGESETUPDLG psd;

>     ZeroMemory(&psd,sizeof(PAGESETUPDLG));
>     psd.lStructSize=sizeof(PAGESETUPDLG);
>     psd.Flags=PSD_RETURNDEFAULT;
>     if (PageSetupDlg(&psd))
>     {
>          ...
>     }

> the psd structure seems to be filled appropriately, but the hDevMode
>member does not point to anything sensible.  Casting that hDevMode to a
>DEVMODE pointer does not work.  How can I access hDevMode?  And, if this
>is the wrong group to ask, I'd appreciate a tip on which one would be
>helpful.

hDevMode (as well as hPrnNames) is a HGLOBAL (a handle to globally
allocated memory); calling GlobalLock(hDevMode) will return an
LPDEVMODE pointer, which points to the DEVMODE for the printer in
question.


Sun, 03 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. PageSetUpDlg( )

2. ::PageSetupDlg

3. Help! Out of memory error while using PringDlg and PageSetupDlg

 

 
Powered by phpBB® Forum Software