HDTenEightyP/NetNews huggingface dataset:
From: udmorrow@mcs.drexel.edu (Daniel Morrow)
Newsgroups: comp.sys.mac.programmer
Subject: Help, I'm in IPCListPorts hell!
Date: 22 Jan 93 02:55:28 GMT
Organization: Drexel University

All I am trying to do is to find ports on a computer which have a specific
creator and file type.

So, naturally, I assumed that in the portName field (in the IPCListPortsPBRec)
should look something like this:
	portName->portKindSelector = ppcByCreatorAndType;
	portName->u.port.creator = kCreator;
	portName->u.port.fileType = kFile Type;

	(or something like this, I don't have the code handy).

	Anyway, I expected IPCListPorts to look at a computer and return
	in the bufferPtr field the programs which meet these criteria.

	But when I actually try this, IPCListPorts always tells me (in the
	actualCount field) that there aren't any programs that match, even
	when I damn well know that they do.

	I'm not getting any error codes returned here.
	I have used IPCListPorts with with the portKindSelector set to 
	ppcByString and this has worked fine. But I can't seem to get it
	work this way.

	I _am_ allocating enough space for the buffer.
	I haven't found any examples in IM-6 on how to do this.

	I am using NBPLookup to get the machine names in the zone. This is
	returning the right stuff.

	If anyone has any source code (or sees any flaws in my logic) please
	let me know. This is most annoying.

	All I am trying to do is count up the amount of programs (of a specific
	creator and file type) which are running over the local zone.

	Again, getting the zone name and the machine names haven't been a
	problem.

	Maybe there's something about this that I just don't know.

	If you know how to do this please contact me. I'm pulling my
	hair out over this. 

	-Dan.
From: kanderso@liege.ICS.UCI.EDU (Kenneth Anderson)
Subject: I've got a handle, now I want a PICT.
Newsgroups: comp.sys.mac.programmer
Date: 23 Jan 93 03:24:06 GMT

I want to start fooling around with PICTs from within my own applications.
So I have written a program which allows you to open a file of type
PICT.  Unfortunately, I don't know how to access the PICT data once I have
opened the file, allocated a new handle and read in the data fork.  I tried
casting the handle to a PicHandle and then I tried passing that to
GetPictInfo, but GetPictInfo returned pictureDataErr.

Can anyone help me out?  Since PicHandle didn't work, what type should I
try casting the generic handle to?

Is there a Technote on this subject?

Let me also tell you my intentions, I eventually want to display a 32 by
32 (pixels) portion of the PICT and let the user roam around the PICT using
the arrow keys.  In order to do this, will I need a PixMapHandle instead?

Thanks in advance,

Ken Anderson
Newsgroups: comp.sys.mac.programmer
From: lecates@bach.udel.edu (Roy LeCates)
Subject: Re: "GLOBAL System Variables", Help!!!
Organization: University of Delaware
Date: Sun, 24 Jan 1993 03:42:30 GMT

In article <1993Jan21.200510.7950@fcom.cc.utah.edu> Dmitry Boldyrev <dmitry@chemistry.chem.utah.edu> writes:
>Does anyone know how to write/read Global variables in THINK Pascal ?
>I have an address of CurActivate ($0A64) and size (4).
>Think Reference says that it's a "Global Variable", but
>when I tried to use it in Pascal it says "unknown indef.".
>" MyWindow := CurActivate; "

You might be able to "trick" the program into looking at $0A64.
Create a variable as a POINTER to a WindowPtr.  Then set it
to 0x00000A64 and dereference it whenever you need to read it.
I'm not sure about Pascal, but the C equivalent would be like this:
...
const WindowPtr *myptr = 0x00000A64;
WindowPtr MyWindow;
MyWindow = *myptr;
...
You could make the 'const' line a global variable, so it's accessable
everywhere.  Enjoy!
-- 
------------------------------------------------------------------
Roy M. LeCates       EE Undergraduate        lecates@bach.udel.edu
University of Delaware Electrical Engineering and Computer Science
------------------------------------------------------------------
From: sherman@michael.nmr.upmc.edu (Sherman Uitzetter)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Windows disappearing (content,structure,768)
Date: 22 Jan 93 16:39:01 GMT
Organization: Pittsburgh NMRI
X-UserAgent: Nuntius v1.1.1d12
X-XXDate: Fri, 22 Jan 93 11:40:39 GMT

In article <1993Jan14.210813.28948@kth.se> Jon Wtte,
d88-jwa@dront.nada.kth.se writes:

... stuff...

>If I make the window 767 pixels wide, the visregion

... stuff ...

>	MoveWindow ( gWindow , 32000 , 32000 , 1 ) ;


  I couldn't help but notice that 32000 + 767 = 32767 (a familiar number,
no?)
  This may be relevant.


-Sherman.
From: soc1070
Newsgroups: comp.sys.mac.programmer
Subject: Modeless Dialogs - Newbie
Date: 25 Jan 93 19:12:00 GMT
Article-I.D.: vx.25JAN199314121566
Organization: University of Minnesota CIS
News-Software: VAX/VMS VNEWS 1.41

I am trying to write a small app that uses a single modless dialog as
an interface. According to IM 1, if you have a modeless dialog, regardless
of what (Get)WaitNextEvent returns, you have to call IsDialogItem (and
SelectDialogItem (?), I can't remember the third function and don't have
the book in front of me) in order to get the caret to blink properly.

I can't seem to get my event loop to track properly, either I can't hit
the menus & command keys, or my radios don't switch. I know the control
code is good (things work ok if I use a modal dialog, but the menus are
disabled).

"Mac C Primer" is no help, it just quickly describes the basic structure
with no example code.

Sorry if this seems haphazard, I don't have my books here at work. Could
someone please post, email me, or point me to some sample code that shows
an event loop with a modeless dialog? 
------
Tim Harincar				A skunk is better company than
soc1070@vx.cis.umn.edu			someone who prides themselves on
 					being frank. -Lazerus Long	
Newsgroups: comp.sys.mac.programmer
From: walkerj@math.scarolina.edu (Jim Walker)
Subject: Re: When is a menu disabled? (enableFlags isn't all)
Organization: USC  Department of Computer Science
Date: 27 Jan 93 14:24:05 GMT

In <toge-270193142420@130.87.65.24> toge@kekvax.kek.ac.jp (Nobu Toge) writes:

>> I can't think of any good way to tell when a modal dialog is in
>> front, either.

>Call _FrontWindow or look up WindowList and look at the windowKind of
>the front-most window.  You can judge by looking whether it's dialogKind 
>or others.  I'm using this in my init and it works rather nicely.

dialogKind does not distinguish between modal dialogs and modeless or
movable modal dialogs.  It appears that spareFlag is true for modal dialogs
and false for other dialogs, but I don't think that is documented.
--

 -- Jim Walker  USC Dept. of Math.  walkerj@math.scarolina.edu
From: bayes@hplvec.LVLD.HP.COM (Scott Bayes)
Date: Mon, 25 Jan 1993 23:50:39 GMT
Subject: Re: faster division routine wanted.
Organization: Hewlett-Packard Co., Loveland, CO
From: chris_russo@gateway.qm.apple.com (Christopher Russo)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Arcade-style animation...
Date: 27 Jan 93 02:40:31 GMT
Organization: Apple

In article <1993Jan25.094256.12845@rulway.LeidenUniv.nl> Theo Vosse, 
vosse@ruls41.LeidenUniv.nl writes:
>Life is simple... Forget the UpdateScreen function, and implement the
>EraseSprite as a copy of the old contents (that were stored under the
>sprite) back to its original position. So, DrawSprite must copy the
>contents of the sprite's position before drawing the actual sprite.

Unless you have sprites overlapping each other, which would lead to some 
ugly flicker and possibly a mess on the screen.  You'll probably want to 
handle overlapping sprites as a special case.  Oh, and get that 'update the 
entire screen during refresh' idea out of your mind completely unless you 
have the secret of Mac page-flipping.

Speaking of which, anyone have some low-level info, like where the screen 
pointer is kept, and the procedure for changing it?  Come on, give with the 
info.

-- Christopher Russo
-- Funny bumper sticker I saw the other day:
-- "Welcome to California, now go home!"
-- day 408.974.6070
Newsgroups: comp.sys.mac.programmer
From: rivero@sol.cie.unizar.es (Alejandro Rivero)
Subject: What is StorySpace?
Reply-To: rivero@sol.cie.unizar.es
Organization: Department of Theoretical Physics. University of Zaragoza
Date: Fri, 22 Jan 1993 21:35:11 GMT

Is it a thina to progran adventures?
Cound anyone email me some info?
From: noel@wtgdir.UUCP (noel)
Newsgroups: comp.sys.mac.programmer
Subject: help with a bug in NOW 4.0
Date: Tue, 19 Jan 93 20:26:50 GMT
Organization: wtgdir
Reply-To: grace!wtgdir!noel@moscom.com

This error keeps popping up and I can only trace it to NOW Utils v4.01.
Any help would be appreciated.

Here is what the debugger has to say:

System error #28 at 4080A2C6 _VRemove
HFS Dispatch = $0006A492

GETWDINFO
"Warning: The command completed without using all parameters."

-----------
I have reinstalled from originals but the crash still pops up every
so often.  The only way I could get it to crash on command was to
do a archive to archive copy in retrospect (w/ the retro scsi init
turned on).

Any help would be appreciated.


Harry Noel
--------------------------------------------------
grace!wtgdir!noel@moscom.com or noel@aber.umsl.edu           
--------------------------------------------------
From: lsr@taligent.com (Larry Rosenstein)
Subject: Re: Verifying valid handles, how to?
Followup-To: comp.sys.mac.programmer
Organization: Taligent, Inc.
Date: Thu, 28 Jan 1993 02:15:13 GMT

In article <1993Jan27.105834.12221@news.unomaha.edu>,
salmon@cwis.unomaha.edu (David Salmon) wrote:
> 
> If you always use ForgetObject, ForgetHandle, etc, your object handles
> will always be NULL after they are deleted. Then you can simply check
> the value of the handle for NULL to see if it has already been deleted.

The problem is when 2 variables refer to the same handle.  One would get
set to NULL but the other will not.

Larry Rosenstein
Taligent, Inc.

lsr@taligent.com
Newsgroups: comp.sys.mac.programmer
From: guapo@cs.columbia.edu (J. Robert Diana)
Subject: Re: Macsbug and Claris
Summary: You can get stuff through ftp at...
Organization: Columbia University Department of Computer Science
Date: Thu, 28 Jan 1993 17:15:54 GMT


I know that you can get the entire application plus what ever documnetation
comes with it bu anonymous ftp from rascal.ics.utexas.edu.  This is also
mirrored at wuarchive.wustl.edu.  Hope this helps some.

Rob Diana
Newsgroups: comp.sys.mac.programmer
Subject: QUED updater for Sys7 & Quadra???
From: chergr@lure.latrobe.edu.au
Date: Thu, 28 Jan 1993 01:11:01 GMT
Organization: VAX Cluster, Computer Centre, La Trobe University 

QUED 2.09 has trouble with its catalog window (no files show) on
a Mac IIfx.
On a Quadra Greg's Buttons cause it to die when the catalog window
is used. 
On a Quadra the program dies when an attempt is made to edit a macro

In other words the program is a bit old and tattered. 

Can someone tell me tha location of an ftp site for the updater
that might fix these problems.

Thanks in advance Richard Rothwell

Newsgroups: comp.sys.mac.programmer
From: Dmitry Boldyrev <dmitry@chemistry.chem.utah.edu>
Subject: "GLOBAL System Variables", Help!!!
X-Xxmessage-Id: <A5A1CBAB3001C4C9@quadra.chem.utah.edu>
X-Xxdate: Tue, 21 Jan 92 10:07:55 GMT
Organization: University of Utah
X-Useragent: Nuntius v1.1.1d17
Date: Thu, 21 Jan 93 20:05:10 GMT

Hello,
Does anyone know how to write/read Global variables in 
THINK Pascal ?
I have an address of CurActivate ($0A64) and size (4).
Think Reference says that it's a "Global Variable", but
when I tried to use it in Pascal it says "unknown indef.".
" MyWindow := CurActivate; "
doesn't work!
Please, help!
Thank You VERY Much! :)
Newsgroups: comp.sys.mac.programmer
From: schultp@wl.com (Paul Schultz)
Subject: WANTED *** AFE Manual, docs, ...
Organization: Warner Lambert / Parke-Davis
Date: Sat, 23 Jan 1993 05:26:19 GMT

Anyone have the APDA manual for Apple File Exchange that
you may be willing to part with?

If so, reply via E-mail. (I don't READ here often)

Paul Schultz
schultp@wl.com

-- 
===============================
Internet: schultp@pd-dom.wl.com
===============================
From: mxmora@unix.sri.com (Matthew Xavier Mora)
Newsgroups: comp.sys.mac.programmer
Subject: Detecting Invalid MCEntries?
Date: 22 Jan 93 18:30:37 GMT
Followup-To: comp.sys.mac.programmer
Organization: SRI International

My MXMClock program that I just released has been crashing 
on a few fx's and one ci. I narrowed it down to the Menu color
entries. Apparently, the MCEntries on these machines is bad or
someone or something is messing with them (init's or cdev's).
I get the color of the menu text and the menubar background
and set my gworlds fore and back color to those values. Without
getting the menu color the clock program works fine on these
machines. With the code its crashes or displays the clock 
in a very light green color.

I seem to remember that apple changed the Menu color resource 
format when it created system 7. Am I running into old Menu 
color resources? How can I detect a valid menu color resources?

Thanks,

Xavier


--
---------------------------------------------------------------------
Matthew Xavier Mora                               mxmora@unix.sri.com
SRI International                                      (415) 859-5011
---------------------------------------------------------------------
Newsgroups: comp.sys.mac.programmer
From: Ravi Konchigeri <mongoose@leland.stanford.edu>
Subject: Seeded random generator in Think Pascal
X-Xxmessage-Id: <A78852C9800100ED@kimball-pc-316.stanford.edu>
X-Xxdate: Sun, 24 Jan 93 14:06:01 GMT
Organization: Stanford University
X-Useragent: Nuntius v1.1.1d16
Distribution: dsg
Date: Sun, 24 Jan 93 22:01:56 GMT

	Can someone send me the function or procedure for producing a seeded
random number in Think Pascal.  I'd also like to know that range and
domain of the function.  Thanx in advance.


	"Just like everything else in life, the right lane ends in half a mile."

Ravi Konchigeri.
mongoose@leland.stanford.edu
From: eric.larson@f620.n2605.z1.ieee.org (eric larson)
Newsgroups: comp.sys.mac.programmer
Subject: Why the Piracy? Here's why...
Date: 24 Jan 93 02:54:05 GMT
Organization: FidoNet node 1:2605/620 - Shockwave Rid, Freehold NJ


 # 1. It's the status quo.  Everyone _already_ copies everything

All that does is make the intellectual property owners look for systems to
protect their investment in other ways. Why do you think we have Macrovision?

Which do you think is better? Crippled DAT systems, and Macrovision, or
intellectual property laws that encourage authors/inventors to develop new
works of intellectual endeavor?

 # 3. If there was no restriction on copying, there would be a
 #    much more `darwinistic' evolution in intellectual
 #    products.  Inferior programs would stand a much smaller
 #    chance of ever being used.  (Example: if Apple software
 #    was not protected by copyright law, there would be cheap
 #    Macintosh clones, and _no-one_ would use MS-DOS or
 #    Windows.)

Well, there would be a Darwinistic evolution all right - companies who develop
strong copy protection schemes would survive. Is this what you want to pay
for? R&D into copy protection schemes?

Look at the proliferation of games for systems like the Nintendo. Why can't I
buy Street Fighter II for my Mac?

Companies whose software was easily copied would fail. Of course, the user
would be more than slightly inconvenienced by these copy protection schemes,
but - I bet you would find pretty quickly that the most desirable software
would also be the most effectively protected software.

--  
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
 eric larson - Internet: eric.larson@f620.n2605.z1.ieee.org
Newsgroups: comp.sys.mac.programmer
From: peter@cujo.curtin.edu.au (Peter N Lewis)
Subject: Re: Verifying valid handles, how to?
Followup-To: comp.sys.mac.programmer
Organization: NCRPDA, Curtin University
Date: Sat, 23 Jan 1993 10:01:36 GMT

In article <1993Jan22.015520.1@fnalo.fnal.gov>, gwatts@fnalo.fnal.gov
wrote:

> the handle is stored in register a1.  I don't know, however, how to check
> if it is a valid handle without causing an error (bus or otherwise) of
> somesort.  Especially if it is a random number!  Anyone know?  Is there

here's a random attempt at it.  First check that the handle is even.  Then
check that it points to an area inside your heap or inside the system heap,
then check that h^ is inside the heap as well, and finally that recover
handle gives the right value.

 function InsideHeap (p: univ ptr; hz: THz): boolean;
 begin
  InsideHeap := (longInt(p) >= longInt(hz)) & (longInt(p) <
longInt(hz^.bkLim));
 end;

 function ValidHandle (h: univ handle): boolean;
  var
   valid: boolean;
 begin
  valid := false;
  if BAND(h, 1) = 0 then begin
   if InsideHeap(h, ApplicZone) then begin
    valid := (BAND(h^, 1) = 0) & InsideHeap(h^, ApplicZone);
   end
   else if InsideHeap(h, SystemZone) then begin
    valid := (BAND(h^, 1) = 0) & InsideHeap(h^, SystemZone);
   end;
  end;
  if valid then begin
   valid := RecoverHandle(h^) = h;
  end;
  ValidHandle := valid;
 end;

(Code tried and tested, but by no means guarenteed)

That would seem to be a good start...
   Peter.

_______________________________________________________________________
Peter N Lewis <peter@cujo.curtin.edu.au>             Ph: +61 9 368 2055
From: Don Lee <DL10@cornell.edu>
Newsgroups: comp.sys.mac.programmer
Subject: Learning TCP/IP Programming
Date: 24 Jan 1993 00:31:15 GMT
Organization: Cornell Information Technologies
Distribution: world
NNTP-Posting-Host: cu-dialup-0117.cit.cornell.edu
X-UserAgent: Nuntius v1.1.1d17
X-XXMessage-ID: <A7874DE54D01EC1B@cu-dialup-0117.cit.cornell.edu>
X-XXDate: Sat, 23 Jan 93 19:32:53 GMT

Where's a good place to start learning about TCP/IP programming
for the Mac?  If anyone can refer me to a good relevant book or
point me to some well documented source code (preferable in 
THINK C) I'd appreciate it.

[I'm interested in learning how to set up a "server" on a Mac into
which others could telnet in --- for starters.]

Don Lee (DL10@cornell.edu)
From: salmon@cwis.unomaha.edu (David Salmon)
Subject: Re: I've got a handle, now I want a PICT.
Organization: University of Nebraska at Omaha
Date: Mon, 25 Jan 1993 15:28:29 GMT

The format of a PICT resourse is documented in TechNote 21 (version 1 PICT)
and there is an extensive description of PICT version 2 resources in IM V
chapter 4 on color quickdraw (near the end of the chapter).

The easiest way to view a PICT is to use the DrawPicture function IM I-190.

Otherwise, you have to parse the picture information yourself (not a
simple task). The PICT data is never simply a PixMap

Newsgroups: comp.sys.mac.programmer
From: kjh+@cs.cmu.edu (Kenneth Hughes)
Subject: Re: When is a menu disabled? (enableFlags isn't all)
Keywords: windowKind, dialogKind, modal, FrontWindow
Organization: School of Computer Science, Carnegie Mellon
Date: Wed, 27 Jan 1993 17:11:10 GMT


Nobu Toge (Nat'l Lab for High Energy Physics) (toge@kekvax.kek.ac.jp) wrote:
> walkerj@math.scarolina.edu (Jim Walker) wrote:                     
> 
> >                        
> > I can't think of any good way to tell when a modal dialog is in
> > front, either.
> >                                                   
> 
> Call _FrontWindow or look up WindowList and look at the windowKind of
> the front-most window.  You can judge by looking whether it's dialogKind 
> or others.  I'm using this in my init and it works rather nicely.

I do not think this speaks to whether the front window is being modally
displayed, only whether it's a dialog/alert (dialogKind), system window/DA
( < 0), or app window (userKind).

Any other ideas, or did I miss Nobu Toge's point?
I'm interested in how to determine this too.


-- 
Kenneth J. Hughes     (kjh@cs.cmu.edu)
Entelechy Corporation
From: gavin@umich.edu (Gavin Eadie)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Where are RAMSDOpen & RAMSDClose?
Followup-To: comp.sys.mac.programmer
Date: 28 Jan 1993 14:38:31 GMT
Organization: University of Michigan
Distribution: world
NNTP-Posting-Host: forfar.uis.itd.umich.edu

In article <C1JGoK.AM5@news.rich.bnr.ca>, brunner@crchh447.bnr.ca (James
Brunner) wrote:
> 
> I need to do I/O to the serial port.  I looked back at some old code that I
> wrote a couple of years back and I am calling RAMSDOpen and RAMSDClose to
> open and close the serial driver.  Now, with the latest version of Think C,
> I can't find these routines.  Have they been obsoleted?  How do I do this?

Yes, they are obsoleted.  What you need is the nice Tech Note "Serial
Driver Q&As" that updates all the serial driver information in one place. 
It's at ftp.apple.com, available for anonymnous ftp, deep in the
dts/mac/tn/... directory. (It's also on the Developer CD)

====
Gavin Eadie   University of Michigan Information Systems
gavin@umich.edu                           (313) 936-0816
Newsgroups: comp.sys.mac.programmer
From: minow@apple.com (Martin Minow)
Subject: Re: App icons won't stay changed!
Date: Tue, 26 Jan 1993 15:38:11 GMT
Organization: Macintosh Developer Services
Followup-To: comp.sys.mac.programmer

In article <1jsto7INNlfv@gizmo.usc.edu>, mharm@gizmo.usc.edu (Mike Harm)
describes problems getting an application's icon to display as intended
-- when he copies the application to a new machine, the same old vanilla
application icon shows up.

Check that you don't have two applications on the same machine with the
same creator id -- this is common for folk doing their own hacking. If
all of your applications have unique (registered with DTS) icons, your
display should look as you intend.

Martin Minow
minow@apple.com
Newsgroups: comp.sys.mac.programmer