
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