Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!uwm.edu!ux1.cso.uiuc.edu!uxh.cso.uiuc.edu!johnsone From: johnsone@uxh.cso.uiuc.edu (Erik A. Johnson) Newsgroups: comp.sys.mac.programmer Subject: BusError in SFGetFile with my DLOG resource. help! Keywords: DLOG bus error SFGetFile SFPGetFile Message-ID: <1991Apr17.071849.2870@ux1.cso.uiuc.edu> Date: 17 Apr 91 07:18:49 GMT Sender: usenet@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 45 Help! I've tried using my own Dialog resources for SFGetFile (in order to add a prompt string to the standard SFGetFile dialog), but the second or third time I try to open a file from within my application, either one of two things happen: an (apparent) infinite loop, or a Bus Error. Both these nasties happen within the StripAddress() function (as described in IM-V-p593). It happens whether I use SFGetFile with the proper DLOG resource #-4000 or use SFPGetFile with a DLOG resource ID of my choice. Any ideas? I'll tack on a small segment of my code after the .sig. E-mail responses and I'll post back to c.s.m.p. Thanks much in advance. Erik A. Johnson, Graduate Student \ Internet: johnsone@uxh.cso.uiuc.edu Aeronautical & Astronautical Engineering \ University of Illinois at Urbana-Champaign \ AmericaOnline: ErikAJ -------------------------- cut here --------------------------------- #define NO_FILTER_PROC 0L #define NIL_PROCPTR 0L #define DIALOG_ID 128 SFTypeList myTypes; SFReply aReply; Point sfgWhere = { 40, 82 }; int numTypes; numTypes = 1; myTypes[0] = 'TEXT'; aReply.good = FALSE; /* option 1: * SFGetFile( sfgWhere, (StringPtr)"\p", NO_FILTER_PROC, numTypes, * &myTypes, NIL_PROCPTR, &aReply ); */ /* option 2: */ SFPGetFile( sfgWhere, (StringPtr)"\p", NO_FILTER_PROC, numTypes, &myTypes, NIL_PROCPTR, &aReply, DIALOG_ID, NO_FILTER_PROC ); if (aReply.good) MyOpenFile( aReply.vRefNum, aReply.fName );