Originally posted by: manavesh ghosh
CreateRegion(int ptop,int pleft,int pbottom,int pright)
if (pRegion->Create(this,ptop,pleft,pright,pbottom)==FALSE)
I modified the same to
if (pRegion->Create(this,ptop,pleft,pbottom,pright)==FALSE)
The code would have been robust if error checking for region creation
CPrintRegion *Region2=pPage->CreateRegion(...);
Original code :
{
....
....
{
....
....
}
}
The if condition evaluated to false and consequently PrintForm1(CPage *pPage) threw an exception.
and it worked fine.
is handled in PrintForm1(CPage *pPage) itself.
if (Region2!=NULL)
{
//
//
}
Originally posted by: Frank Kobs
Problem:
CPage::Print returns the next row which can be used for positioning to the next line.
The return value of "Print" is not correct if empty strings are passed.
Solution:
Comment line 110 and 111 in CPrinter.cpp:
//if(strlen(ps->Text)==0)
// return 2 * ps->PointSize;
I have not tested for sideeffects, but it seems to work.
Regards,
Frank
Originally posted by: Nick Alabaster
Project won't compile as download is without PrintDev.rc2, Toolbar.bmp, Doc.ico, PrintDev.ico. Simply copy and rename default versions into .\res and project compiles OK.
ReplyOriginally posted by: Frank Kobs
Dear Richard,
thanks for providing such a helpful class for printing!
I just used it for half an hour and find it really helpful...
Just one small improvement comes in my mind:
When you change the char *fmt to const char *fmt inside the ::Print declarations/bodies, You can also use the class with CStrings without any conversions.
With best regards,
Frank
Reply