Link to home
Start Free TrialLog in
Avatar of EKarim
EKarim

asked on

LoadLibrary() fails to 16-bit DLL or Windows driver

I had a 16-bit application which uses LoadLibrary() to load a printer driver(HPPCL5MS.drv) and it worked fine. I converted the application to 32-bit. The application fails to load HPPCL5MS.DRV using LoadLibrary() in Win95. GetLastEror() return error 31. Can someone help me on this?

Hare is part of the code:

HINSTANCE hPrintDriver;
hPrintDriver = LoadLibrary("c:\\windows\\system\\hppcl5ms.drv");

if (hPrintDriver == NULL)
{
   dwLastError = GetLastError();
   ASSERT(FALSE);//ERROR OCCURRED.
   return;
}
//
//  Get a DEVMODE structure
//
LPFNDEVMODE lpfnDevMode = (LPFNDEVMODE)GetProcAddress(hPrintDriver, "ExtDeviceMode");

Avatar of EKarim
EKarim

ASKER

Edited text of question.
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial