Microsoft KB Archive/101154

{| = PRB: RUN /N CONTROL PRINTERS Behaves Differently in .EXE File =
 * width="100%"|

ID: Q101154

2.50 2.50a WINDOWS kbprg kbprb

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

Keywords         : FxtoolMBuilder Version          : 2.50 2.50a Platform         : WINDOWS
 * }