Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!linac!att!news.cs.indiana.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: Check DialogPtr returned by GetNewDialog? Message-ID: <1991Apr1.052536.27902@ux1.cso.uiuc.edu> Date: 1 Apr 91 05:25:36 GMT Sender: usenet@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 26 Do any of you check to see if the DialogPtr that GetNewDialog returns is valid in any way? Is there any way to determine that GetNewDialog had no problems (i.e. it found the necessary resources and got the necessary memory allocated)? IM-I-413 says "If either the dialog template resource or the item list resource can't be read, the function result is undefined." I tried: DialogPtr aDialogPtr; ... aDialogPtr = 0L; aDialogPtr = GetNewDialog( ... ); if (aDialogPtr == 0L) { /* got some sort of error */ } else { /* do the dialog stuff */ } This seems to work, but given the above quote from IM, I'm hesitant to count on it working. Any suggestions? E-mail and I'll summarize. Thanks. Erik A. Johnson, Graduate Student \ Internet: johnsone@uxh.cso.uiuc.edu Aeronautical & Astronautical Engineering \ University of Illinois at Urbana-Champaign \ AmericaOnline: ErikAJ