Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application Launcher

Status
Not open for further replies.

RoadRunnerOz

Programmer
Aug 22, 2000
128
AU
I'm looking for a front end application launcher for all my company's executables. I tried putting all the files and locations in a table then setting up a grid. Double clicking to run the program. It just gives me a GPF each time. Is there a commercial product out there or any ideas how to approach this?? I want to be able to launch multiple programs from this interface.
This reason I need this is so I can just change the exe name in a table and VOILA the users now will be running the latest exe.

TIA
 
Need more details to know why your GPF occurs. Which version of VFP you use? Which data types you use in your tables (in other words, table structure), only fields shown in grid are of interest. Where is a code you use to launch programs?
Finally, VFP 6 SP3 have strange GPF bug for textbox in grid. When field have 254-255 characters length, you will get crash each time you set focus to such text box in grid. Reproduced many times, but sometimes it works (I don't know when, usually I got crash). Setting field length to less number (say 200) or changing it to memo field and show editbox in grid instead of textbox helps here.
 
VFP6 SP4

I have a table in a database with the following fields:
Description C(40) "Accounts"
path C(100) "E:\applicatons\acc\"
exe C(30) "accounts.exe"

I just created a simple grid by dragging the fields to my form through the dataenvironment.

On dblclick of the first column I put:
set defa to alltr(This.Parent.Parent.Column2.Text1.value)

run /N alltr(This.Parent.Parent.Column2.Text1.value)+alltr((This.Parent.Parent.Column3.Text1.value))

I also tried:

do alltr(This.Parent.Parent.Column2.Text1.value)+alltr((This.Parent.Parent.Column3.Text1.value))

The programs all work just fine outside of my "launcher"

The selected program starts to run then I get the GPF:

VFP6 caused an invalid page fault in
module VFP6.EXE at 0157:00401948.
Registers:
EAX=00000000 CS=0157 EIP=00401948 EFLGS=00010216
EBX=000282c3 SS=015f ESP=00a3f8b0 EBP=00a3f958
ECX=01569c34 DS=015f ESI=007e0000 FS=12e7
EDX=000282c3 ES=015f EDI=01569c24 GS=0000
Bytes at CS:EIP:
8b 10 8b 41 04 8b 49 14 56 8b 18 57 8b f9 33 f6
Stack dump:
00a3f958 000282c3 00a3f904 000282c3 56433230 00401690 000002a0 0000000c 01569c24 00a3f978 00408c08 00000f88 00000082 00000000 00000000 00408c1a

AAAAARRRRGGGGHH!!!!! Thanks....
 
Never use RUN comand. It is quite old and made to run old DOS commands and programs. Might not work in many places.
Try following:

PROCEDURE RunEXE
LPARAMETERS pcEXEName, pcParameters
* first parameter required, other - optional
* returns - .T. when successful, .F. when failed

local lcAppRunString
if parameters() > 1
m.lcAppRunString = ' ' + pcParameters
else
m.lcAppRunString = ''
endif
m.lcAppRunString = allt(m.pcEXEName) + m.lcAppRunString

&& Function declaration
DECLARE INTEGER WinExec IN kernel32 STRING lpCmdLine, INTEGER uCmdShow

&& try run exe

IF WinExec(m.lcAppRunString, 1) > 31
&& running exe successfully
RETURN .T.
ENDIF

RETURN .F.
ENDPROC

In addition, you may try to use registry to find path to any correctly installed EXE applications (all of pathas stored just in 'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths' in registry)
 
Thanks mate! This is the code I "extracted" from a program called applauncher! Its EXACTLY what I needed. Thanks [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top