Board index » cppbuilder » Printing multiple copies

Printing multiple copies


2007-01-24 03:24:21 AM
cppbuilder61
Hello,
I have a problem that I cannot find a good solution.
OwlNext 6.20 / WinXP
I cannot print multiple copies from all my applications with Owl on some
printers
like : HP LaserJet 1320 and HP Color LaserJet 2600n.
Even a simple application generated by AppExpert won't allow to print
multiple copies.
I'm surprised that nobody else has come with the same problem.
All other applications like Word, Notepad etc... does not have this problem.
Is it a bug with Owl ?
So far I founded that if I remove the minor part of the Subsystem
version in Options/Linker/General
(leaving only the major part without a dot and a number) I can then
print multiple copies.
But this is causing a side effect : a full line of pixels is not drawn
on top of the THarbor Speed Bar
leaving this line with garbage.
Any ideas how I can solve this ?
Thanks,
Rejean
 
 

Re:Printing multiple copies

Quote
I cannot print multiple copies from all my applications with Owl on some
printers
like : HP LaserJet 1320 and HP Color LaserJet 2600n.
Even a simple application generated by AppExpert won't allow to print
multiple copies.
I'm surprised that nobody else has come with the same problem.
All other applications like Word, Notepad etc... does not have this
problem.
Is it a bug with Owl ?
I know one of my colleagues fixed this with Owl. I used to blame it on
the printer drivers, as it worked with some printers. I cannot remember
what the resolution was, but hopefully I should be able to find out when
I am back in the office.
Charles
 

Re:Printing multiple copies

Thanks Charles for your interest.
Quote
I know one of my colleagues fixed this with Owl. I used to blame it on
the printer drivers, as it worked with some printers. I cannot
remember what the resolution was, but hopefully I should be able to
find out when I am back in the office.

Charles
I don't know if I should blame on the printer drivers because it print
multiple copies :
->when I remove the minor part of the Subsystem version using OWL
or
->when I use Charles Petzold example (in the book Programming Windows)
wich does not use OWL
So far I fixed the problem in that way:
// I derivated a TPrinter
bool MyTPrinter::ExecPrintDialog(TWindow* parent)
{
Data->Flags |= PD_USEDEVMODECOPIESANDCOLLATE;
bool ok = TPrinter::ExecPrintDialog(parent);
if( Data->Copies == 1 )
{
DEVMODE* dm = const_cast<DEVMODE*>(Data->GetDevMode() );
Data->Copies = dm->dmCopies;
dm->dmCopies = 1;
}
return ok;
}
This solution works fine but I feel this is not a nice workaround.
If you have a better solution I will be happy to look at it.
Rejean
 

{smallsort}

Re:Printing multiple copies

Rejean Bouchard wrote:
Quote
Thanks Charles for your interest.

>I know one of my colleagues fixed this with Owl. I used to blame it on
>the printer drivers, as it worked with some printers. I cannot
>remember what the resolution was, but hopefully I should be able to
>find out when I am back in the office.
>
>Charles
I don't know if I should blame on the printer drivers because it print
multiple copies :
->when I remove the minor part of the Subsystem version using OWL
or
->when I use Charles Petzold example (in the book Programming Windows)
wich does not use OWL


So far I fixed the problem in that way:

// I derivated a TPrinter
bool MyTPrinter::ExecPrintDialog(TWindow* parent)
{
Data->Flags |= PD_USEDEVMODECOPIESANDCOLLATE;
bool ok = TPrinter::ExecPrintDialog(parent);
if( Data->Copies == 1 )
{
DEVMODE* dm = const_cast<DEVMODE*>(Data->GetDevMode() );
Data->Copies = dm->dmCopies;
dm->dmCopies = 1;
}
return ok;
}

This solution works fine but I feel this is not a nice workaround.
If you have a better solution I will be happy to look at it.

Rejean
Hello,
I am trying to investigate the problem, but currently I don't
have a printer at hand .... does this problem appear when
setting the printing to file?
I also found that OWLNext calls the old PrintDlg function,
which under Win2K/XP is superseded by PrintDlgEx - I think
OWLNext should check the operating system version and call
the newer function when available.
Jogy
 

Re:Printing multiple copies

Hi,
Quote

Hello,

I am trying to investigate the problem, but currently I don't
have a printer at hand .... does this problem appear when
setting the printing to file?

Yes, the program only asks one time for a file name.
Quote

I also found that OWLNext calls the old PrintDlg function,
which under Win2K/XP is superseded by PrintDlgEx - I think
OWLNext should check the operating system version and call
the newer function when available.

Jogy

This is a good point.
The solution might be there.
I will try to look at it and see if I can do something.
Thanks for your help.
Rejean
 

Re:Printing multiple copies

Quote
This is a good point.
The solution might be there.

I will try to look at it and see if I can do something.
Thanks for your help.

The only change I could see we made to printdia.cpp was:
Line 350:
HDevNames = ::GlobalAlloc(GHND, sizeof(DEVNAMES)+ (size1+size2+size3) *
sizeof(_TCHAR));
The last sizeof, but I suspect that related to unicode. I would have to
check with the developer.
Charles
 

Re:Printing multiple copies

Charles Pope wrote:
Quote
>This is a good point.
>The solution might be there.
>
>I will try to look at it and see if I can do something.
>Thanks for your help.
>
The only change I could see we made to printdia.cpp was:
Line 350:
HDevNames = ::GlobalAlloc(GHND, sizeof(DEVNAMES)+ (size1+size2+size3) *
sizeof(_TCHAR));

The last sizeof, but I suspect that related to unicode. I would have to
check with the developer.

Charles
Hello,
this might not be related to Rejean's problem if he
is not using Unicode, but it's a bug nevertheless.
I will include this correction in the OWLNext source.
Jogy
 

Re:Printing multiple copies

Quote
this might not be related to Rejean's problem if he
is not using Unicode, but it's a bug nevertheless.
I will include this correction in the OWLNext source.

Jogy
Thanks. I appreciate all the work you have done.
There are a couple of very minor things we changed so that things would
compile, I think for BDS.
In file.cpp:
Insert:
26: #include <istream>
Amended:
2584: #if defined(BI_COMP_MSC) || (__BORLANDC__>= 0x580)
2593: #if defined(BI_COMP_MSC) || (__BORLANDC__>= 0x580)
In objstrm.cpp:
923: #if !defined(BI_STD_IO) || (defined(BI_COMP_BORLANDC) &&
(__BORLANDC__ < 0x580))
941: #if (defined(BI_COMP_BORLANDC) && (__BORLANDC__>0x580))
942: else if( buf.attach(f) )
943: #else
941: else if( buf.open(f) )
945: #endif
I think that is about all we changed to get everything running smoothly
in BDS 2006.
Charles
 

Re:Printing multiple copies

Quote
Thanks. I appreciate all the work you have done.

There are a couple of very minor things we changed so that things would
compile, I think for BDS.

In file.cpp:
Insert:
26: #include <istream>

Amended:
2584: #if defined(BI_COMP_MSC) || (__BORLANDC__>= 0x580)
2593: #if defined(BI_COMP_MSC) || (__BORLANDC__>= 0x580)

In objstrm.cpp:
923: #if !defined(BI_STD_IO) || (defined(BI_COMP_BORLANDC) &&
(__BORLANDC__ < 0x580))

941: #if (defined(BI_COMP_BORLANDC) && (__BORLANDC__>0x580))
942: else if( buf.attach(f) )
943: #else
941: else if( buf.open(f) )
945: #endif

I think that is about all we changed to get everything running smoothly
in BDS 2006.

Charles
Thanks, I will include these changes too.
Jogy
 

Re:Printing multiple copies

Hi,
I took a few days off and now that I'm back, I see a few answers to my post.
So,
thanks to both of you, Charles and Jogy, for your interest.
As Jogy mentionned, I am not using Unicode, so this correction won't fit
my needs.
Quote
The only change I could see we made to printdia.cpp was:
Line 350:
HDevNames = ::GlobalAlloc(GHND, sizeof(DEVNAMES)+ (size1+size2+size3)
* sizeof(_TCHAR));
A special Thank You for all the work you're doing for the OWL users.
Quote
I will include this correction in the OWLNext source.
Rejean