Making Mouse Pointer Visible When Debug .FLL in Visual C++

Last reviewed: June 27, 1995
Article ID: Q116318
The information in this article applies to:
  • Microsoft FoxPro Library Construction Kit for Windows, versions 2.5, 2.6

SUMMARY

When you are attempting to debug a .FLL file, the mouse pointer will disappear while the debugger is active. Furthermore, when a Windows dialog box is used, the mouse will be disabled.

MORE INFORMATION

To avoid this problem, add the Windows ShowCursor() function to the .FLL file. You can also use this technique to make the mouse active when calling Windows dialog boxes.

The following example calls the Windows Printer dialog box and makes it modal to Foxpro by passing the handle to the FoxPro window through the MainHwnd() function found in FOXTOOLS.FLL.

Sample Code

FoxPro Code:

   SET LIBRARY TO Foxtools.fll
   SET LIBRARY TO Printdlg.fll ADDITIVE

   =printdlg(mainhwnd())


C Code:

   #include <windows.h>
   #include <commdlg.h>
   #include <pro_ext.h>


   void FAR printdlg(ParamBlk FAR *prt)
   {
        static     PRINTDLG pd;
        ShowCursor(TRUE);
       pd.lStructSize = sizeof(PRINTDLG);
        pd.hwndOwner   = (HWND)prt->p[0].val.ev_long;
        pd.hDevMode    = NULL;
        pd.hDevNames   = NULL;
        pd.Flags       = PD_RETURNDC;
        pd.nMinPage    = 1;
        pd.nMaxPage    = 1000;
        pd.nCopies        = 1;

        PrintDlg(&pd);
        ShowCursor(FALSE);
   }


   FoxInfo myFoxInfo[]={
        {"PRINTDLG",(FPFI)printdlg,1,"I"},
   };

   FoxTable _FoxTable={
   (FoxTable FAR*)0, sizeof(myFoxInfo) / sizeof(FoxInfo), myFoxInfo
   };

REFERENCES

FoxPro Library Construction Kit "Developer's Guide," version 2.5


Additional reference words: FoxWin 2.50 2.60 API
KBCategory: kbinterop kbtool kbprg kbcode
KBSubcategory: FxprgFoxtools


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.