Path: utzoo!utgpu!watmath!att!dptg!ulysses!andante!bwb From: bwb@andante.UUCP (Bruce Ballard) Newsgroups: comp.sys.mac.programmer Subject: Launching from LSC Message-ID: <21866@andante.UUCP> Date: 8 Aug 89 14:34:26 GMT Organization: AT&T Bell Laboratories, Murray Hill Lines: 64 How can I achieve a Launch in Lightspeed C? I've studied TN-126 on (Sub)Launching, and I've read the pages 3-17/3-18 in Programmer's Guide to MultiFinder, but I always get a beep followed by a termination of my program, which according to p. 3-18 means an error has occurred when I'm not asking to sublaunch. But I've (tried to) set LaunchFlags to 0xC0000000. Any hints? I'm running with LSC 3.0 under MultiFinder on a Mac II with lots of megs. Here's how I define the interface: typedef struct LaunchStruct { char *pfName; short int param; char LC[2]; long int extBlockLen; short int fFlags; long int launchFlags; } LaunchStruct; pascal OSErr LaunchIt(pl) LaunchStruct *pl; { asm { move.l (a7)+,a0 _Launch move.w d0,(a7) } } and here's the code: LaunchStruct myLaunch; HFileInfo myPB; SFReply reply; SFTypeList typs = {'APPL', 0, 0, 0}; Point sfpoint = {10,10}; MyLaunch(sublaunch) int sublaunch; {OSErr err; SFGetFile(sfpoint, "", 0L, 1, typs, 0L, &reply); if (!reply.good) return; myPB.ioNamePtr = (StringPtr)reply.fName; myPB.ioVRefNum = reply.vRefNum; myPB.ioFDirIndex = 0; myPB.ioDirID = 0; err = PBGetCatInfo((CInfoPBPtr)&myPB, false); if (err != noErr) return; err = SetVol(0L, reply.vRefNum); if (err != noErr) return; myLaunch.pfName = (char *)&reply.fName; myLaunch.param = 0; myLaunch.LC[0] = 'L'; myLaunch.LC[1] = 'C'; myLaunch.extBlockLen = 6; myLaunch.fFlags = myPB.ioFlFndrInfo.fdFlags; if (sublaunch) myLaunch.launchFlags = 0xC0000000; else myLaunch.launchFlags = 0x00000000; LaunchIt(&myLaunch); }