Kyle Eberle
May 7th, 1999, 03:11 PM
Hello,
I am trying to alter the page size in order to accomodate some continuous form issues.
I have tried the following:
CDC dcPrinter;
dcPrinter.Attach(dlg.m_pd.hDC);
DEVMODE* dm = (DEVMODE*)::GlobalLock(dlg.GetDevMode());
dm->dmOrientation = 1;
dm->dmFields = DM_ORIENTATION|DM_PAPERSIZE|DM_PAPERLENGTH|DM_PAPERWIDTH|DM_COPIES;
dm->dmPaperSize = DMPAPER_USER;
dm->dmPaperLength = 304;
dm->dmPaperWidth = 88;
dm->dmCopies = 2;
::GlobalUnlock(dlg.GetDevMode());
dcPrinter.ResetDC(dm);
The dmCopies and dmOrientation work fine. I can even change the dmPaperSize to DMPAPER_LEGAL,
DMPAPER_LETTER, etc.
However, when I change dmPaperSize to either 0 or DMPAPER_USER and then try to specify
dmPaperLength and dmPaperWidth it reverts back to the default page size. I have not tried this
in Win95 yet, but this is the behavior in WinNT. I have tried many different methods of altering
the DEVMODE structure and passing it to the Device, but all have failed.
Any suggestions?
Thanks,
Kyle
I am trying to alter the page size in order to accomodate some continuous form issues.
I have tried the following:
CDC dcPrinter;
dcPrinter.Attach(dlg.m_pd.hDC);
DEVMODE* dm = (DEVMODE*)::GlobalLock(dlg.GetDevMode());
dm->dmOrientation = 1;
dm->dmFields = DM_ORIENTATION|DM_PAPERSIZE|DM_PAPERLENGTH|DM_PAPERWIDTH|DM_COPIES;
dm->dmPaperSize = DMPAPER_USER;
dm->dmPaperLength = 304;
dm->dmPaperWidth = 88;
dm->dmCopies = 2;
::GlobalUnlock(dlg.GetDevMode());
dcPrinter.ResetDC(dm);
The dmCopies and dmOrientation work fine. I can even change the dmPaperSize to DMPAPER_LEGAL,
DMPAPER_LETTER, etc.
However, when I change dmPaperSize to either 0 or DMPAPER_USER and then try to specify
dmPaperLength and dmPaperWidth it reverts back to the default page size. I have not tried this
in Win95 yet, but this is the behavior in WinNT. I have tried many different methods of altering
the DEVMODE structure and passing it to the Device, but all have failed.
Any suggestions?
Thanks,
Kyle