Microsoft KB Archive/111990

{| = _FP Macros in the LCK Different Between MS C and WATCOM C =
 * width="100%"|

ID: Q111990

2.00 2.50 | 2.50

MS-DOS   | WINDOWS kbinterop kb3rdparty kbprg The information in this article applies to:


 * Microsoft FoxPro Library Construction Kit for MS-DOS, version 2.0
 * Microsoft FoxPro Library Construction Kit for MS-DOS and Windows, version 2.5

SUMMARY
Calling the C macros to return a far pointer offset or a far pointer segment can give you different results in WATCOM C and Microsoft C.

MORE INFORMATION
The C macros _FP_OFF and _FP_SEG (in Microsoft C) or FP_OFF and FP_SEG (in WATCOM C) as their names imply are meant to deal with far pointers. You can, however, pass a near pointer to them and get different results depending upon which C compiler you use.

If you pass a near pointer in a Microsoft C compiled library, you will get garbage return values that could in turn cause a general protection (GP) fault if you were to call intdosx from FoxPro for Windows.

However, WATCOM'S macros are able to handle the non-far pointer and thus return valid information that can be used by a call such as one to intdosx.