Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!dino!news.iastate.edu!du248-16.cc.iastate.edu!niko From: niko@du248-16.cc.iastate.edu (Schuessler Nikolaus E) Newsgroups: comp.sys.mac.programmer Subject: Re: Can't seem to get SFGetFile to work....! Message-ID: <1990Sep22.232806.26935@news.iastate.edu> Date: 22 Sep 90 23:28:06 GMT References: <9183@potomac.ads.com> Sender: usenet@news.iastate.edu (USENET News Poster) Reply-To: niko@iastate.edu (Schuessler Nikolaus E) Organization: Iowa State University Lines: 50 > >Well the call to selectFile causes a Bus Error right on the SFGetFile >and I can't figure out why. I've checked with other Macintosh books > >selectFile(char *name) >{ > char fName[FILE_NAME_SIZE + 1]; > Point position; > int numTypes; > OSType tList; /* Was SFTypeList */ > SFReply reply; > int workingVrefNum; > Str255 prompt; > > numTypes = -1; > SetPt(&position,DEFAULT_DIALOG_X_POS,DEFAULT_DIALOG_Y_POS); > tList = '????'; > > SFGetFile(position, "\p", 0L, numTypes, &tList, 0L, &reply); I know the following code works.... The only difference is that you allocated 1 space for an OStype, where SFTypeList allocates 4. Hmmph. { SFReply reply; SFTypeList typeList; Point Pt; Pt.h=100; Pt.v=100; pStrCopy(FileName,"\p"); SFGetFile(Pt,"\p",0L,-1,typeList,0L,&reply); if (reply.good) pStrCopy(FileName,reply.fName); *vref=reply.vRefNum; return reply.good; } It sorta looks like the same piece of code, huh? -- ------------------------------------------------------------------------------ Niko Schuessler "On a two semester mission to engineer where niko@iastate.edu no-one has engineered before.... :-) " ------------------------------------------------------------------------------