|
-
June 14th, 2000, 04:43 AM
#1
How to print multiple copies?
Hi,
I want to print multiple copies by changing the value of dmCopies in m_pd of CPrintDialog class.
It works fine for most of the printers, but when I tried it on Canon BJ-200e it always prints out one copy only. Can anyone tell me what's wrong with my program? Thanks in advance.
//get default print dialog values
CPrintDialog dlg(FALSE);
if (dlg.GetDefaults())
{
LPDEVMODE lpdm = (LPDEVMODE)GlobalLock (dlg.m_pd.hDevMode);
char szPrinterDevName[CCHDEVICENAME];
if (lpdm != NULL)
{
//set number of copies to print
lpdm->dmCopies = m_iNumOfCopy;
//m_iNumOfCopy is the number of copies to
//get printer name
memcpy(szPrinterDevName, lpdm->dmDeviceName, sizeof(lpdm->dmDeviceName));
CString stPrinterDevName;
stPrinterDevName = szPrinterDevName;
DEVMODE *InitData = dlg.GetDevMode();
m_hDC = CreateDC(NULL, szPrinterDevName, NULL, InitData);
if (m_hDC == NULL)
return FALSE;
GlobalUnlock(dlg.m_pd.hDevMode);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|