You Can Call a DLL Function from a Printer DriverLast reviewed: June 16, 1995Article ID: Q131639 |
The information in this article applies to:
SUMMARYA printer driver can call other DLL functions if the rules for loading the DLL are followed correctly.
MORE INFORMATIONTo have a printer driver call other DLL functions, you need to make sure the functions in the called DLL are using the PASCAL calling convention. For example, the prototype of the DLL function would look similar to this:
< return type > PASCAL dll_function ( param1, param2,......);The DLL can be loaded either explicitly or implicitly. A printer driver can implicitly import DLL functions at link time when the IMPORTS section of the driver's module definition (.DEF) file includes the functions of the called DLL. It can also use the LoadLibrary function to load the DLL and then use the GetProcAddress function to retrieve the address of the required function. You should check the returned values from LoadLibrary and GetProcAddress to ensure that these functions succeed. If the DLL is not found or does not export the desired function, one of these calls would fail. A prime example of printer driver calling another DLL is the minidriver, which calls the Microsoft Universal printer driver. The minidriver uses implicit linking (.DEF file); that is, it imports all the functions implicitly at run time.
|
Additional reference words: 3.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |