BUG: _WSetPort Function in LCK Does Not Work

ID: Q108334

The information in this article applies to:

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

Last Reviewed: June 27, 1995