SF package fails under A/UX 2.0.1

Tony Cooper tony at tui.marcam.dsir.govt.nz
Thu May 2 14:47:18 AEST 1991


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 at albert.dsir.govt.nz



More information about the Comp.unix.aux mailing list