How FoxPro Uses Universal Thunking for 32-Bit API CallsLast reviewed: November 18, 1997Article ID: Q118557 |
2.5x 2.6x 3.00 | 2.5x 2.6x
WINDOWS | MS-DOSkbinterop kbprg The information in this article applies to:
SUMMARYThere are two methods of creating 32-bit applications in 16-bit versions of Windows (versions 3.1x). FoxPro uses two variations of the universal thunking (UT) method through the WATCOM compiler in order to perform 32-bit Windows API calls.
MORE INFORMATION
Method 1: The Universal ThunkThere are three main components of the universal thunk:
----------- ----------- --------- | Win32 EXE |-->| Win32 DLL |<->| Win32 | 32-bit | (stub) | | (UT) | | DLL | ----------- ----------- --------- /|\ /|\ -------------|----------------|--------------------- \|/ \|/ --------- ------------ | Win 3.1 | <-> | 16-bit DLL | 16-bit | app. | | (UT) | --------- ------------The load order is as follows:
The Windows 3.0 or 3.1 application loads the 16-bit DLL. The 16-bit DLL checks to see whether the 32-bit side has been initialized. If it has not been initialized, the DLL spawns the 32-bit .EXE (stub), which then loads the 32-bit DLL that sets up the universal thunks with the 16-bit DLL. Once all components are loaded and initialized, when the Windows 3.0 or 3.1 application calls an entry point in the 16-bit DLL, the 16- bit DLL uses the 32-bit universal thunk callback to pass the data to the 32-bit side. Once the call has been received on the 32-bit side, the proper Win32 DLL entry point can be called. Method 2: Using the Win32sThe Win32s consists of three components:
Win32s is not built into Windows 3.0 or 3.1, so software vendors must ship and install Win32s (on the DEVICE = line of the WIN.INI file) along with the Win32 application in order to have the Win32 application work under Windows 3.0 or 3.1. The key feature of Win32s is to allow software developers to ship Win32 applications today for Windows 3.0 or 3.1 and Windows NT that will continue to install and work well on future Windows operating systems.
FoxPro for Windows MethodThe WATCOM compiler is used to provide the thunking layer between Windows and FoxPro. FoxPro 2.5x for Windows and MS-DOS are both 16-bit applicaiton.. Any addresses or pointers that need to be passed to and from Windows 3.0 or 3.1 must be "thunked" down to 16 bit; the WATCOM compiler is used to perform the translation. FoxPro 2.6 uses the WATCOM compiler (32-bit) and the Phar Lap extender for thunking. It can run on Windows 3.0 and later, including Windows for Workgroups.
|
Additional reference words: VFoxWin 3.00 FoxDos FoxWin 2.50 2.50a 2.50b
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |