• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 431
  • Last Modified:

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");

0
EKarim
Asked:
EKarim
1 Solution
 
EKarimAuthor Commented:
Edited text of question.
0
 
chensuCommented:
In Win32, you should use DocumentProperties instead of ExtDeviceMode. See

INFO: Use of DocumentProperties() vs. ExtDeviceMode()
http://support.microsoft.com/support/kb/articles/Q92/5/14.ASP

Calling ExtDeviceMode/DeviceCapabilities in Win32s App
http://support.microsoft.com/support/kb/articles/q132/2/39.asp

HOWTO: Modify Printer Settings with DocumentProperties()
http://support.microsoft.com/support/kb/articles/Q167/3/45.ASP
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now