Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!iuvax!cica!tut.cis.ohio-state.edu!pt.cs.cmu.edu!andrew.cmu.edu!kw1r+ From: kw1r+@andrew.cmu.edu (Kevin Whitley) Newsgroups: comp.sys.mac.programmer Subject: Re: Help me please Message-ID: <8YlT4ky00VQa01skZw@andrew.cmu.edu> Date: 20 Jul 89 15:35:12 GMT Organization: Center for Design of Educational Computing, Carnegie Mellon, Pittsburgh, PA Lines: 49 Jon, If you happen to be using Lightspeed C, the easiest thing to do is to use their routine execl. You would use it as follows execl("volume:folder1:folder2:program"); and it goes. This has the disadvantage of needing a path, which is easy to hardcode, awkward to get out of the StdFileDialog. A more Mac approach (in LSC) is: DoLaunch() /* run a launch */ /* returns FALSE for cancelled dialog */ { SFReply launchFile; long tList; Point atWhere; ioParam volDat; SetPt(&atWhere,100,80); /* upper left corner of where dialog box will appear */ tList = 'APPL'; /* so dialog box lists applications */ SFGetFile(atWhere,0L,0L,1,&tList,0L,&launchFile); /* run dialog */ if (!launchFile.good) { /* user cancelled */ return(FALSE); } /* change volume (or working directory) to where application is */ volDat.ioCompletion = 0L; volDat.ioNamePtr = 0L; volDat.ioVRefNum = launchFile.vRefNum; PBSetVol(&volDat,FALSE); /* do the launch */ Launch(0,launchFile.fName); return(TRUE); /* shouldn't ever get here! */ } Kevin Whitley kw1r@andrew.cmu.edu