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

ID: Q116318

The information in this article applies to:

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

Last Reviewed: June 27, 1995