This is really great work. I will try to use it. I just have a problem when trying to go through code step by step to see exactly how it works. I can't set breakpoints. I started in CMainView::OnPrint(...) and it just won't work...
Sometimes the text erases a small part of the border or a line.
To solve this add
to the member function
int CPrinter::PrintText(PRTTYPE *ps,double LineSpacing)
on line 130.
In this way the text is also transparent on top of a bitmap.
i realized that if u print from File->Print and
File->Print Preview->Print, u will get two different
results. the former sends ID_FILE_PRINT message id
whereas the latter sends AFX_ID_PREVIEW_PRINT. if u have
a single view of a single doc, then there would not
be a problem printing from either one. however, there
would be a problem printing from a multiview of a single
doc... anyone know how i can intercept AFX_ID_PREVIEW_PRINT
so that it calls the appropriate CView::OnFilePrint()?
Fix for floating point error in the Printing Class Library.
Problem was the program would work fine when compiled
in the debuging mode, but would casue a floating point
error to occurr when printing a Table when compiled in the
release mode. This problem was very random and would not
always crash in the same place. I found that the variable
" TheTable->EndRow " was being used without being
initialized first. This was the random cause for the
floating point error.
I was compiling a 16 Bit application with Visual C++
1.52 when this occurred. I also have and compile with
Visual C++ 6.0, but have not tried these functions in that
environment. The fix is listed here.
Many thanks Richard, for this great Printing Class Library !
I have had the most programming problems with printing and
this Class is one BIG HELP to me.
void CPage::Table(TABLEHEADER* TheTable)
// Not a part of original code but is needed
// because it is used here without being
// initialized first.
// This caused a floating point error to occure at
// random when compiled in the release mode using VC 1.52c
// Allen Friend 08/02/1999
// Note: The header file says not to set this, that it is
// calculated for you...., but without this being set here
// it is calculated from a random value at the start and
// the numbers generated are huge values.....
TheTable->EndRow = 0.00;
when used in a project with settings for "use MFC in static library" there are no errors or warnings during compile but the application crashes when
CPrintRegion *Region1=pPage->CreateRegion(.5,0.0,1.5,3.9); is used.
when used as "use MFC in shared DLL" the linker generates a warning "LNK4089: all references to msvcp60.dll discarded by /opt:ref" and the application works without crashing.
any ideas what could be wrong. I would like to compile it and run it using "use MFC in static library"