Calling a New 32-bit API from a 16-bit Application

Last reviewed: September 29, 1995
Article ID: Q125674
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows 95 version 4.0
    

SUMMARY

Windows 95 supports a new set of APIs for 32-bit applications. These APIs are exported by USER32, GDI32, KERNEL32, and so on. In Windows 95, some of these new APIs are also exported by the 16-bit counterpart DLLs in the system such as USER16, GDI16, and so on. But 16-bit applications running on Windows 95 should not call these new APIs from the 16-bit system DLLs because these calls are not unsupported and might be removed from the 16-bit system DLLs in the future.

MORE INFORMATION

APIs such as WindowFromDC(), SetWindowRgn(), SetForeGroundWindow(), and so on for 16-bit USER window management and PolyBezier(), PolyBezierTo(), and so on for 16-bit GDI graphics management are exported from the 16-bit system DLLs.

Even though these APIs are intended for 32-bit applications, the 16-bit system DLLs export some of them. 16-bit Windows 95 Applications should not call them. They are not supported and the APIs will not work as intended.

If Windows 95 Applications need to use these APIs, port the 16-bit application to 32-bit. This is the best solution and is the one that Microsoft recommends. One addtional solution is to write a 32-bit DLL that actually calls the 32-bit API; then the 16-bit application can thunk into this 32-bit DLL. However, Microsoft strongly discourages developers from having applications thunk into sytem DLLs (16- or 32-bit).


Additional reference words: 4.00
KBCategory: kbui
KBSubcategory: UsrMisc


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 29, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.