PRB: RUN /N CONTROL PRINTERS Behaves Differently in .EXE File

Last reviewed: April 29, 1996
Article ID: Q101154
The information in this article applies to:

  - Microsoft FoxPro for Windows, versions 2.5 and 2.5a

SYMPTOMS

If the RUN /N CONTROL PRINTERS command is put into a menu option, the menu has a foundation READ, and an .EXE file is built, the Control Panel Printers dialog box appears briefly in the foreground and then disappears behind the .EXE file's main window.

RESOLUTION

Instead of using the RUN /N CONTROL PRINTERS command, add the PROMPT clause to the end of the command used to print a report or label. This clause will bring up the Print dialog box. For example:

   REPORT FORM test TO PRINTER PROMPT

   -or when you are printing labels-

   LABEL FORM test TO PRINTER PROMPT

MORE INFORMATION

In the FoxPro development environment, or in an application, issuing a RUN /N CONTROL PRINTERS command from the Command window causes the Printers dialog box in the Windows Control Panel to come up in the foreground and not behind the main window.

Steps to Reproduce Problem

  1. Create a quick report called TEST.

  2. From the File menu, choose New, select Menu, and then choose New.

  3. In the Menu Builder, add the following:

           Prompt          Result       Command
           ---------------------------------------------------------------
    
           PRINT           COMMAND      RUN /N CONTROL PRINTERS
    
           REPORT          COMMAND      REPORT FORM test TO PRINTER PROMPT
    
           QUIT            PROCEDURE    m.done=.T.
                                        CLEAR READ ALL
    
    

  4. In the Setup section of the menu, include this code:

    PUBLIC m.done m.done=.F

  5. In the Cleanup section of the menu, include this code:

    READ VALID m.done

  6. Save the menu and call it TEST.

  7. Open a project. Add the TEST menu and the TEST report.

  8. Mark the TEST menu as the main program.

  9. Choose Build, select Build Executable, and call it TEST.EXE.

  10. In the Windows Program Manager, choose Run from the File menu.

  11. In the Run box, type the following and press ENTER:

    test

  12. Choose Print from the menu bar.

Note that the Printers dialog box is drawn in the foreground and then disappears. Choose Report, and note that a Print dialog box comes up, as expected.


Additional reference words: MBuilder FoxWin 2.50 2.50a
KBCategory: kbprg kbprb
KBSubcategory: FxtoolMBuilder


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: April 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.