_FP Macros in the LCK Different Between MS C and WATCOM C

Last reviewed: October 10, 1997
Article 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().

REFERENCES

Microsoft C/C++ "Run-Time Library Reference," version 7.0, page 293-294

Microsoft Visual C/C++ "Reference Volume III: Run-Time Library

  Reference," version 1.0, page 234

WATCOM C "Library," version 9.0, pages 195-196

WATCOM C "Library Reference," version 8.5, pages 188-189


Additional reference words: 2.00 2.50 lck far-pointer gpf
KBCategory: kbinterop kb3rdparty kbprg
KBSubcategory:


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: October 10, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.