Microsoft Knowledge Base Email Alertz

(151891) - A print driver can call GDI functions having the same name as printer- driver entry-point functions by explicitly or implicitly reloading GDI.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 151891 - Last Review: February 12, 2007 - Revision: 2.2

How To Call GDI Functions from a Print Driver

This article was previously published under Q151891

SUMMARY

A print driver can call GDI functions having the same name as printer- driver entry-point functions by explicitly or implicitly reloading GDI.

MORE INFORMATION

Windows 95 printer drivers export functions that have the same name as the GDI functions. In order to call the GDI functions from a printer driver, such as BitBlt, ExtTextOut, etc., do the following:

  1. Import the GDI functions in the .DEF file under the IMPORTS section of the driver's .DEF file and use the imported function names.
  2. Do a LoadLibrary on GDI.EXE and obtain the address of the desired function to be called using the GetProcAddress function. Once the address is obtained, the function can be called using the function pointer.
  3. Define a DLL with functions that will call the GDI functions and IMPORT the DLL functions in the printer driver. For example, to call a GDI function, you would call the corresponding function in the DLL that, in turn, would make the GDI function call.

APPLIES TO
  • Microsoft Windows 95 Driver Development Kit (DDK)
  • Microsoft Windows 98 Driver Development Kit (DDK)
  • Microsoft Windows Millennium Edition Driver Development Kit
Keywords: 
kbprint KB151891
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate