[comp.sys.mac.programmer] Opening a driver at INIT time and other DRVR stuff

jwinterm@jarthur.Claremont.EDU (Jim Wintermyre) (02/28/91)

I'm trying to write a screen saver in which the main "screen saver" cade is 
implemented as a driver.  I've gotten it to work when I just include all of 
the code in the INIT code itself, but I'm having problems with the driver
idea.  I can get it to sort-of work when I just open the driver whenever it's
time for the screen-saver to come on, and close it when it's time to restore
the screen (actually it crashes when called after notification manager 
alerts).  However, if I try to open it at INIT time, it doesn't work at all.
It crashes with random errors.  I know that the dCtlStorage field is not
being allocated when I try to open it at INIT time (I have a SysBeep to tell
me that).  I think that this is probably the reason for why it is failing,
but I don't know why it's not being allocated.  I'm using THINK Pascal 3.0,
and I'd be interested to know how the dCtlStorage field is allocated in
THINK Pascal, as well as how exactly the 'DATA' resource (which is created
with the DRVR) is used.  I suspect that is where all the driver globals are
stored.  Anyway, if anybody has any ideas on this, I'd really appreciate
a response.  If there's any source out there, that would be even better.

Thanks,
  Jim Wintermyre

jwinterm@jarthur.claremont.edu
jwintermyre@hmcvax.claremont.edu