Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!cs.utexas.edu!mailrus!ncar!umigw!umiami!chuck From: chuck@umiami.miami.edu Newsgroups: comp.sys.mac.programmer Subject: THINK C and SFGetFile w/FSOpen Message-ID: <6533.269b32ac@umiami.miami.edu> Date: 11 Jul 90 18:07:40 GMT Organization: Univ. of Miami (IR) Lines: 40 Hello folx. I'm working with THINK C 4.0.2. I'm trying to do a simple SFGetFile and FSOpen procedure to open up a file so I can do some processing. For some reason, it seems that the SFGetFile is getting a bad address, and I get a system bomb when FSOpen is called. Any ideas? Check out my code below. By the way, the SFGetFile dialog box comes up, and myWindow shows up, too. Everything points to a problem with either where reply points to, or a problem with the way I'm handling FSOpen. .. { Point where; SFReply *reply; int sourceFile; where.v=100; where.h=100; SFGetFile(where," ",0L,0,'',0L,&reply); myWindow=GetNewWindow(314,0L,-1L); ShowWindow(myWindow); SetPort(myWindow); MoveTo(30,30); if (FSOpen((*reply).fName,(*reply).vRefNum,&sourceFile)!=noErr) DrawString("\pCan't FSOpen File."); else DrawString("\pFSOpening file."); FSClose(sourceFile); } (I hope there's no typos in this!!! :-) ) -- =========================================================================== Chuck Urwiler University of Miami Music Engineering Voice & Keys chuck@umiami | e1mvqi9z@umiamivm | Go ahead, I DARE you to mail me something... chuck@umiami.miami.edu | chuck@miavax.ir.miami.edu | =========================================================================== Disclaimer: I only work and learn at this University. I don't speak for it!