[comp.sys.mac.programmer] Tops/Driver incompatibility

tim@hoptoad.uucp (Tim Maroney) (05/02/90)

In article <79873@tut.cis.ohio-state.edu> <thitt@cis.ohio-state.edu> writes:
>I am having a compatability problem with a driver I wrote and Tops
>and would appreciate anyones insights.
>
>The driver is opened from Hypercard and then one
>communicates with it via synchronous PBControl calls buried
>in XCMDs.  This works very well -- normally. 
>
>When Tops is running, the PBControl call returns a qErr (-1) as
>both the function's value and in the ioResult of the ParamBlockRec.
>The control routine of the driver never gets invoked.

Hmm.  The obvious question is whether your driver and TOPS are trying
to use the same slot.  TOPS crawls the unit table at INIT time to find
a free driver slot or two, so if you've turned off TOPS, some driver
slots will be used that wouldn't be otherwise.  I don't know why this
would return a qErr -- but anyway, if you make sure your driver falls
into the range of slots that is reserved for application-specific desk
accessories, this shouldn't happen.  Or even better, crawl the unit
table yourself to make sure you get an unused slot.

>I've researched the problem in Inside Mac and qErr can comes
>from a Dequeue - presumably when the PBControl call wants to
>remove my call from the driver's queue, even though the driver's
>control routine never gets invoked.
>
>Does anyone have any suggestions?  I'd really like to get this
>fixed.

Well, if the above doesn't work, then the obvious thing to do is break
into MacsBug when you call _Control, step into it, and find out where
that error's getting generated.  You could even do it the easy way with
a Step Spy on your ioResult.
-- 
Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com

"Every year, thousands of new Randoids join the ranks.  Most tend to be either
 too-rich self-made tycoons or picked-on computer nerds (the romantic, heroic
 individualism of Rand's novels flatters the former and fuels the latter's
 revenge fantasies)." -- Bob Mack, SPY, July 1989