Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
App vs. exe
Message
From
12/07/2001 10:53:11
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
11/07/2001 15:53:44
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00529406
Message ID:
00529728
Views:
9
It seems the file is erased before the other program can open it. Once you call the other program, VFP continues running.

I had a similar problem when viewing text files, generated in my program, with NotePad.exe (or some NotePad-replacement). The solution I used is to create a Timer that erased the file after 5 minutes, or on program shutdown (which destroyed the timer), whatever occured first.

Hilmar.

>Help:
>I've written a EXE called PrintScreen.exe in Delphi 5. This VFP program file is invoked by Shift-F5 combination from within my VFP 6.0 sp5 app. Compiled as an EXE, but run as do MRM in the command window, everything works as expected. When I run MRM.exe from Windows 2000, the PrintScreen.exe app, generates an error "Cannot open file 56347638.bmp". I'm using Steve Ruhl's ScrnPrint utilities from the files section and Ed Rauh's API_AppRun utility.
>
>I'm guessing that the BMP files isn't quite closed when PrintScreen tries to load it. After the error message, I can dbl-click on it on the HD and my Futuris Imager app, loads it just fine.
>
>TIA,
>Mike Timpe
>Micro Vane, Inc.
>
>
>
>* BEGIN PRINTSCR.PRG()
>* Description:
>* Parameters: -
>* -
>* Returns: -
>* Notes: 1.
>* 2.
>* Revisions: 07/11/2001 - MWT
>* - Created
>
>local lnSelect
>local lcProcedures
>local lcImageFileName
>lcProcedures = SET( "PROCEDURE" )
>lnSelect = select()
>
>create cursor PrintScreen (ScreenPrt G, Notes M)
>select PrintScreen
>append blank
>
>SET PROCEDURE TO appmeth additive
>lcImageFileName = SaveasBitmap()
>SET PROCEDURE TO (lcProcedures)
>oRunit = newobject("Api_AppRun", "Process.vcx")
>oRunit.icCommandline = "PrintScreen.exe " + (lcImageFileName)
>oRunit.LaunchAppAndWait()
>oRunit = .NULL.
>Delete File lcImageFileName
>
>select (lnSelect) && Restore to the original work area
>
>* END PRINTSCR.PRG()
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform