Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ulowell!hawk!jkeegan From: jkeegan@hawk.ulowell.edu (Jeff Keegan) Newsgroups: comp.sys.mac.programmer Subject: Open/CloseDriver & Think Pascal Message-ID: <14736@swan.ulowell.edu> Date: 2 Sep 89 11:52:48 GMT Sender: news@swan.ulowell.edu Reply-To: jkeegan@hawk.ulowell.edu (Jeff Keegan) Organization: University of Lowell, CS Dept Lines: 51 I'm having a few problems with drivers that I think are THINK Pascal (2.0) related, but I'm not sure.. I'll describe them and leave it to whoever wants to reply to specify which they think it is. First, I'm not getting my Open command called more than once, ever. I've written an open routine (for testing purposes) that ALWAYS opens a window and draws into it either "First time" for the first case, or "Already Open" for the 2nd, 3rd, etc. It then waits for a mouseclick and disposes of the window. I call this driver with an application that calls OpenDriver. It works fine the first time through, but after that the window isn't even created. To make sure it wasn't something simple I've messed up, I put a SysBeep right after the Open routine begins (before deciding if my global "alreadyOpen" is true or false), and it is only called the first time through. This won't be a major problem in writing the driver (I can always check with a status call), but I am curious as to why it is not calling it a second time (since in Desk Accessories I've written, it has worked (using Lightspeed 1.11)). Second.. I load this driver into the system heap (via the "system heap" option in ResEdit or THINK Pascal 2.0) and do a detach resource on it so that it can run from application to application. (Can this affect question #1? Hmm).. After I do the CloseDriver routine and end the application, the driver seems to still be lying around in the system heap (I see this using TMON).. I have it purgeable and unlocked, but it still lies there. Now normally I wouldn't care (might as well keep system resources around in case you need them, right?) but for developing this has been a pain, because (and I have checked this MANY times) when I recompile and build a new version of the driver, the old one hanging around in memory is the one that gets called. I have the driver stored in a file that my application uses in the "run options" resource box, and I have made sure to compile the driver and then the application. I imagine I could have the application do a GetResource and do some call to purge it from memory, but shouldn't CloseDriver be handling this for me? It's not a lot to do, since it's currently only bothering me in the development phase, but should it be necessary for the user to purge a driver with the same name and ID# once it's closed? Lastly, since I'm posting a THINK Pascal question, just what IS the latest version? (I've seen mentions of 2.01 or 2.1 recently, and feel outdated). What has been fixed? ..Jeff Keegan ------------------------------------------------------------------------------- | Jeff Keegan | I clutch the wire fence until my fingers bleed | | jkeegan@hawk.ulowell.edu | A wound that will not heal | |----------------------------| A heart that cannot feel | | This space intentionally | Hoping that the horror will receed | | left blank | Hoping that tomorrow we'll all be freed -RUSH | -------------------------------------------------------------------------------