BUG: _WSetPort Function in LCK Does Not Work

Last reviewed: June 27, 1995
Article 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

SYMPTOMS

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.

RESOLUTION

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

   fpdt=_WSetPort(wh);

with:

   fpdt=_WGetPort();
       =_WSetPort(wh);

STATUS

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.

MORE INFORMATION

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
               *)0,WO_PANELBORDER);
            _WShow(wh);
            fpdt = _WSetPort (wh);
            _Execute ("Wait");
            fpdt = _WSetPort (fpdt); /* Restore FoxPro Desktop */
            _WClose (wh);
         }
         FoxInfo myFoxInfo[] = {
            {"ONE",(FPFI)One,CALLONLOAD,""}
         };
         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


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: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.