Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!waikato.ac.nz!comp.vuw.ac.nz!am.dsir.govt.nz!tui.marcam.dsir.govt.nz!tony Newsgroups: comp.unix.aux Subject: SF package fails under A/UX 2.0.1 Message-ID: <1991May2.044718.4058@am.dsir.govt.nz> From: tony@tui.marcam.dsir.govt.nz (Tony Cooper) Date: Thu, 2 May 91 04:47:18 GMT Reply-To: sramtrc@albert.dsir.govt.nz Sender: news@am.dsir.govt.nz Organization: Applied Mathematics Group D.S.I.R. Lines: 36 I wrote a simple program to read a file. The program works fine under both MacOS and A/UX using Think C. But I have spent two days trying to get it to work using the cc compiler and it doesn't properly. Here's the code: { Point where; short numTypes; SFReply reply; SFTypeList typeList; char *prompt; where.h = 50; where.v = 50; numTypes = -1; prompt = ""; sfgetfile(where, prompt, nil, numTypes, typeList, nil, &reply); } I inserted it as is into sample.c just after the initializations. Since I used sample.c (in /mac/src) the rest of the program should be correct. Under mac32 from commandshell I type sample and the program works. Good. But when I run it by double clicking, it crashes due to trying to execute code at 0000000A (which isn't a good place to try executing code). The SF dialog is briefly displayed with some files listed before the crash. Looks like something is not initialised properly (null pointer) when launched by double clicking, but is OK when launched from the UNIX command line. The behaviour is the same whether I use shared libraries or not. Apart from the above lines, everything else is the same as for the sample program. Anyone any idea what's going on? Thanks, Tony Cooper sramtrc@albert.dsir.govt.nz