🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.mac
Article #5912

Re: Request for help with SFGetFile

#5912
From: Gregory Stein
Date: Mon, 02 Jun 1986 21:03
38 lines
1591 bytes
Keywords:

> I'm having trouble with the following code in Lightspeed C.  It
> bombs with ID = 2 when run.  Can anybody shed some light on what I'm
> doing wrong?
>
> #include "Lightspeed:stdio.h"
> #include "Lightspeed:MacTypes.h"
> #include "Lightspeed:StdFilePkg.h"
> main()
> {	Point apoint;
>	SFReply reply;
>	SFTypeList typelist;
>
>	apoint.v = 80;
>	apoint.h = 80;
>	typelist[0] = 'TEXT';
>	typelist[1] = 'WORD';
>	SFGetFile(apoint, "\p ", (ProcPtr) 0, 2, typelist, (ProcPtr) 0, &reply);
> ...
> }
>
> Mike Ching
> {decwrl,ucbvax}!amdcad!amd!ching
>

I'm not familiar with Lightspeed C, but it could be that it is
passing the entire structure of 'apoint' to SFGetFile.  So, the
correct call would be:

  SFGetFile(&apoint, "\p ", (ProcPtr) 0, 2, typelist, (ProcPtr) 0, &reply);

In Megamax C, I have to pass all Point's as &pt.  This is strange
because somewhere in Inside Mac it says points are passed as long
values instead of addresses.  Who knows?  Give the & a try.

Greg Stein
ARPA: gjs@k.cs.cmu.edu
Technical Details
Message-ID: <1010@k.cs.cmu.edu>
Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!cmcl2!seismo!rochester!pt.cs.cmu.edu!k.cs.cmu.edu!gjs

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!cmcl2!seismo!rochester!pt.cs.cmu.edu!k.cs.cmu.edu!gjs
From: gjs@k.cs.cmu.edu (Gregory Stein)
Newsgroups: net.micro.mac
Subject: Re: Request for help with SFGetFile
Message-ID: <1010@k.cs.cmu.edu>
Date: Mon, 2-Jun-86 17:03:29 EDT
Article-I.D.: k.1010
Posted: Mon Jun  2 17:03:29 1986
Date-Received: Wed, 4-Jun-86 07:42:22 EDT
Reply-To: gjs@k.cs.cmu.edu (Gregory Stein)
Distribution: net
Organization: Carnegie-Mellon University, CS/RI
Lines: 38