[comp.sys.mac.programmer] What? No kiss goodbye? You tease!

gurgle@well.sf.ca.us (Pete Gontier) (01/18/91)

Folks:
 
I'm in the process of writing a few modules, among them "sDA" (DA Supervisor)
and "cMEL" (Main Event Loop Collection) for our libraries. I am trying to
cover as many bases as I possibly can in a general-case piece of code.
 
At the moment, I have a do-nothing DA running both standalone and in THINK's
debugging environment.
 
The thing I can't seem to get to work is the goodbye kiss. I go ahead and
whack the DCE's control flags with the appropriate bit mask, but I'm not
getting any goodbye kiss when I tell the host app to quit (as opposed to
actually closing the DA). Here's a code snippet:
 
	static mERR_code DrvrOpen ( DCtlPtr pDCE ) {
		mERR_code e;
	
		if ( ! pDCE -> dCtlStorage )	return ( kDrvrOpenFail );
		if ( gOpenStatus )		return ( kDrvrOpenFail );
 
		/* other stuff */
	
		pDCE -> dCtlFlags |= dNeedGoodBye | dNeedTime;
		gOpenStatus = eAlreadyOpen;
		return ( noErr );
	}
 
I have also tried
 
		pDCE -> dCtlFlags |= dNeedGoodBye | dNeedTime;
 
during every call to the DA, regardless of the message. That doesn't help.
 
I actually did have the goodbye kiss working at one point, but that was before
I got the close message working, and now the goodbye kiss has stopped coming
through.
 
Ideas?

mandel@vax.anes.tulane.edu (Jeff E Mandel MD MS) (01/18/91)

In article <22703@well.sf.ca.us> gurgle@well.sf.ca.us (Pete Gontier) writes:
>Folks:
> 
>The thing I can't seem to get to work is the goodbye kiss. I go ahead and
>whack the DCE's control flags with the appropriate bit mask, but I'm not
>getting any goodbye kiss when I tell the host app to quit (as opposed to
>actually closing the DA).

I looked at my working code and found that I always set this in the driver's
resource:

resource 'DRVR' (dNum, ".JFMDriver", locked,preload) {
	needLock,
	dontNeedTime,
	needGoodbye,		/* Hey you! Here! Look Here! */
	statusEnable,
	ctlEnable,
	noWriteEnable,
	noReadEnable,
	0,						/* drvrDelay */
	activMask|updateMask|mDownMask|keyDownMask|autoKeyMask, 			/* drvrEMask */
	ResID,					/* drvrMenu */
	"JFMDriver",			/* drvrName */
	$$resource("JFMDriver.DRVW", 'DRVW', 0)
};


Since my code works, and this is the way that the MPW manual suggests doing it,
it might be worth trying.

Jeff E Mandel MD MS
Asst. Professor of Anesthesiology
Tulane University School of Medicine
New Orleans, LA