Path: utzoo!attcan!uunet!clyde.concordia.ca!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!wuarchive!psuvax1!psuvm!cunyvm!ndsuvm1!plains!puklich From: puklich@plains.UUCP (Blayne Puklich) Newsgroups: comp.sys.mac.programmer Subject: Re: THINK C and SFGetFile w/FSOpen Message-ID: <5263@plains.UUCP> Date: 12 Jul 90 18:31:09 GMT References: <6533.269b32ac@umiami.miami.edu> Organization: North Dakota State University, Fargo Lines: 24 chuck@umiami.miami.edu wrote in article THINK C and SFGetFile w/FSOpen: >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. [stuff deleted] >SFReply *reply; ^ There's your problem. >SFGetFile(where," ",0L,0,'',0L,&reply); ^ The SFReply you have declared is a pointer to an SFReply struct, not an actual SFReply struct on the stack. So, &reply means the address of the SFReply pointer on the stack, which you haven't allocated. What you may want to do is change the declaration to SFReply reply, and then the SFGetFile() call will work just fine. Hope this helps. ||+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|| || Blayne Puklich puklich@Plains.NoDak.EDU "I think I'm going bald..." || || NDSU, Fargo, ND (701) 237-4408 -- Rush, Caress of Steel, || || 1975 || ||-------------------------------------------------------------------------||