Porting to Maintain DB-Library Compatibility with Windows

DB Library for C

DB Library for C

Porting to Maintain DB-Library Compatibility with Windows

You can port a 16-bit DB-Library application for the Microsoft® Windows® operating system to the Microsoft Win32® API for Microsoft Windows NT® 4.0, Windows 95 or Windows 98 operating systems while retaining compatibility with applications for Windows.

API Calls for Windows and C Run Time

In general, you can change your source code to easily build 16-bit or 32-bit versions. For an in-depth discussion of writing applications for the Win32 API that retain compatibility with the Windows operating system, see the Microsoft Win32 API Programmer's Reference (available separately).

Follow these guidelines when developing applications for the Win32 API:

  • Be sure that your function definitions and prototypes use portable data types.

  • The widening of handles to 32-bits means that the packing of handles and other values in wParam and lParam has changed. Verify whether or not you need to change the decoding of wParam and lParam in your application.
DB-Library Functions

All DB-Library functions are completely portable between operating systems. You simply need to define the target operating system at compile time.

Many DB-Library functions return values of type int. Note that the int data type is a 16-bit value in Windows and a 32-bit value in the Win32 API. Therefore, verify that your application uses the correct type of variable to receive return values from DB-Library functions that return an int data type. For example, a variable defined as the data type short receives a correct int value from DB-Library in Windows but receives an incorrect value in the Win32 API.

Apart from verifying that variables receiving return values from DB-Library are of the correct type, no changes are needed to DB-Library functions.