Printing problem in windows 95

Printing problem in windows 95

Post by Chris Norri » Wed, 15 Jan 1997 04:00:00

We have this application that prints fine under Windows NT 4.0 and 3.51.
However when it is run under Windows 95 it always uses the default fonts
and no matter how you change the parameters in the CreatePointFont
function it still grabs the wrong font so we believe there is a problem in this
particular CreateDC.  We are using an HP4SI the drivers are installed, the
system is configured correctly to use this printer.  I have included a code
fragment to see if anyone out here has any ideas.

                PRINTDLG printDlg;
        CWinApp *theApp = AfxGetApp();
        if (!theApp->GetPrinterDeviceDefaults(&printDlg))
                SetCursor(LoadCursor(NULL, IDC_ARROW));
                AfxMessageBox("No default printer set up or a printer error detected.");
                return FALSE;

        DEVNAMES FAR *pDevNames = (DEVNAMES FAR *)::GlobalLock(printDlg.hDevNames);
        DEVMODE devMode;
        memcpy(&devMode, (DEVMODE FAR *)::GlobalLock(printDlg.hDevMode), sizeof(DEVMODE));
        CString strDriver((LPCSTR)pDevNames + pDevNames->wDriverOffset);
        CString strDevice((LPCSTR)pDevNames + pDevNames->wDeviceOffset);
        CString strOutput((LPCSTR)pDevNames + pDevNames->wOutputOffset);

        CDC *m_pDC = new CDC;
        //This is used in windows NT and works fine this does not work in windows 95
        if (!m_pDC->CreateDC(strDriver, strDevice, strOutput, &devMode))
                AfxMessageBox("Unable to create Device driver for printer.");
                delete m_pDC;
                return FALSE;
        CFont DiffFont;
        DiffFont.CreatePointFont(ReportFileHolder.GetReportFontPoint() * 10, ReportFileHolder.GetReportFontName(), m_pDC);
        CFont *oldFont = (CFont*)m_pDC->SelectObject(DiffFont);

        //This is what I next attempted to use to create the DC for windows 95 still did not work
        if (!m_pDC->CreateDC(/*strDriver*/ NULL, strDevice, /*strOutput*/ NULL, &devMode))
                AfxMessageBox("Unable to create Device driver for printer.");
                delete m_pDC;
                return FALSE;

The person that wrote this code is no longer here so I have been tasked with

Chris Norris


1. Stubborn problem printing from MS access - probably a Windows 95 congifuration problem

Can somebody help?

I can't print anything from Microsoft Access to my HP laserjet5L

All my other programs (including MSWORD, Excel, etc.) print fine.

I've already reinstalled MS Office, Windows 95, and the Laserjet
driver.  No luck.

The error message:  "Cannot print to this device.  Make sure the device
is available"

It clearly isn't a hardware problem, but the computer can't find the
printer.  This ONLY happens in ACCESS.

I just started working on this computer recently, and have no idea how
carefully it was set up.  As near as I can tell, Microsoft ACCESS was
not used by the previous owner, so it's not a matter of it previously
working and then something went wrong.

Any suggestions on what to try next?

Thanks in advance for help anyone can provide.

Dave Litterer

2. Tv Card doesn't work in XP

3. Printing Question: How to stop windows 95 from displaying the printing document message box

4. Class Installer error

5. Problemas de Windows 95/problems with windows 95

6. A dynamic Link library initialization Failed when creating a SampleGrabber in XP

7. JetDirect, Windows 95 and WordPerfect 7 Printing Problem

8. TROUBLE!! 1.44 floppy drive

9. Printing Problem on Windows 95

10. Windows 95 print problem

11. Windows 95 and network printing problem

12. Help - Windows 95 Printing Problem

13. Problems with printing from DOS applications under Windows 95