Microsoft KB Archive/108334

From BetaArchive Wiki

BUG: _WSetPort Function in LCK Does Not Work

ID: Q108334

The information in this article applies to:

  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6
  • Microsoft FoxPro Library Construction Kit, version 2.5


The _WSetPort() function of the FoxPro Library Construction Kit (LCK) does not return the correct WHANDLE to the previous window on the Microsoft Windows platform.


To work around this problem, use _WGetPort(), which returns the correct value. To correct the sample code in the "More Information" section below, replace the following line





Microsoft has confirmed this to be a problem in FoxPro 2.5, 2.5a, 2.5b, and 2.6 for Windows and in the FoxPro 2.5 Library Construction Kit. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Steps to Reproduce Problem

1. Using any compiler, build a FoxPro link library (.FLL) file from the

   following C code:

     #include <PRO_EXT.H>
     void FAR One ()
        WHANDLE wh,fpdt;
        wh = _WOpen (1,1,10,50,CLOSE,USER_SCHEME,(Scheme FAR
        fpdt = _WSetPort (wh);
        _Execute ("Wait");
        fpdt = _WSetPort (fpdt); /* Restore FoxPro Desktop */
        _WClose (wh);
     FoxInfo myFoxInfo[] = {
     FoxTable _FoxTable = {
        (FoxTable FAR *)0,
        sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo

2. In FoxPro for Windows, execute the following commands:

     SET LIBRARY TO <.FLL created in step 1>
     ? "Hello" && This should cause a GP Fault

   NOTE: In FoxPro version 2.6, a "Resource Manager Internal Consistency
   Error" message will be displayed just prior to the GP fault.

Additional reference words: FoxWin 2.50 2.50a 2.50b lck gpf buglist2.50 buglist2.50a buglist2.50b 2.60 buglist2.60 KBCategory: kbprg kbbuglist KBSubcategory: FxtoolLck

Last Reviewed: June 27, 1995
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.