Print / Print Preview Commands 
Author Message
 Print / Print Preview Commands

Hi,

Pretty new to Visual C++ 6, so ......
I have an app that can display two different form views.
One conatins all current customers and the other extended
details about any one particular customer.
Running the application in debug mode:
From the all customer view, I can print or print preview
no problem. Switching to the single customer form if I
try
to print or print preview I get a debug error.
Debug assertion failed wingdi.cpp line 1077

Which checking line 1077 in wingdi.cpp is:
ASSERT(m_hObject == NULL ||
(afxData.bWin95 || ::GetObjectType(m_hObject) != 0));

Tracing through my code it fails when running the
following line and then going into the Windows MFC
scripts.
pDC->SelectObject(OldFont);

The strange thing is that printing from the all customers
form uses the exact same class and runs OK.
Hope someone can give me an indication as to what is
causing the assert failure, thanks in advance.

Steve



Mon, 22 Aug 2005 05:02:52 GMT  
 Print / Print Preview Commands

Quote:
> pDC->SelectObject(OldFont);

Not sure, but are you deleting the New Font once selected?

There are a lot of problem related to deleting and selecting objects into
the device context.

HTH,

Quote:
> Hi,

> Pretty new to Visual C++ 6, so ......
> I have an app that can display two different form views.
> One conatins all current customers and the other extended
> details about any one particular customer.
> Running the application in debug mode:
> From the all customer view, I can print or print preview
> no problem. Switching to the single customer form if I
> try
> to print or print preview I get a debug error.
> Debug assertion failed wingdi.cpp line 1077

> Which checking line 1077 in wingdi.cpp is:
> ASSERT(m_hObject == NULL ||
> (afxData.bWin95 || ::GetObjectType(m_hObject) != 0));

> Tracing through my code it fails when running the
> following line and then going into the Windows MFC
> scripts.
> pDC->SelectObject(OldFont);

> The strange thing is that printing from the all customers
> form uses the exact same class and runs OK.
> Hope someone can give me an indication as to what is
> causing the assert failure, thanks in advance.

> Steve



Mon, 22 Aug 2005 20:24:02 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Print Preview Control and Print Preview Dialog - need some help ASAP

2. customizing print properties dialog box when print command or setup command is invoked

3. Adding Print and Print Preview to Richedit Control

4. Why I can't print directly after Print Preview

5. Printing/Print preview problem with CRichEditView.

6. Print Preview and Printing a Document?

7. Printing / Print Preview problem?

8. Display bitmaps in Print Preview and printing bitmaps.

9. image shown on print preview but not printed

10. Text on screen looks differently that when printed/print previewed

11. abort print and print preview

12. Print preview doesn't work, but print ok

 

 
Powered by phpBB® Forum Software