Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!well!oster From: oster@well.sf.ca.us (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: Writing an RDEV under THINK C 4.0 Keywords: THINK C, RDEV, Chooser Message-ID: <17175@well.sf.ca.us> Date: 11 Apr 90 08:22:25 GMT References: <3166@moondance.cs.uq.oz.au> Reply-To: oster@well.UUCP (David Phillip Oster) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 61 In article <3166@moondance.cs.uq.oz.au> tonyg@batserver.cs.uq.oz.au writes: >I am attempting to write an RDEV to work under Chooser. The language I >am using is THINK C 4.0, and I'm having problems getting the chooser to >display buth the buttons in the dialog. It also doesn't appear to be >calling my code at all. I just did this recently. Success depenmds on careful reading of the Device Manager chapter of Inside Mac Vol4. You will see that the header that THINK C generates is not quite right. here is the complete text of a C program to fix up the header of your resource: /* X-10PACKFixer - Copyright 1990 by David Phillip Oster The point of this program is to install the flags long word in the header of the PACK of the X-10 gateway the hex constant means: uses AppleTalk, handles the following procedures: */ #define bAppleTalk (1L << 31) #define bMultiSelect (1L << 28) #define bLeftButton (1L << 27) #define bRightButton (1L << 26) #define bNoSaveZone (1L << 25) #define bUseZoneName (1L << 24) #define bNewSel (1L << 16) #define bFillList (1L << 15) #define bGetSel (1L << 14) #define bSelect (1L << 13) #define bDeselect (1L << 12) #define bTerminate (1L << 11) main(){ LongInt *np; Handle h; Integer res; /* This stuff is so Vaccine won't croak */ InitGraf((Ptr) &thePort); InitFonts(); InitWindows(); InitCursor(); InitDialogs(NIL); TEInit(); if(-1 != (res = OpenResFile((StringPtr) "\pYourFileHere"))){ if(NIL != (h = GetResource('PACK', -4096))){ np = (LongInt *) (*h + 0xC); *np = bAppleTalk | bGetSel | bSelect | bDeselect; SetResPurge(TRUE); ChangedResource(h); SysBeep(1); } CloseResFile(res); } } -- -- David Phillip Oster - Note new address. Old one has gone Bye Bye. -- oster@well.sf.ca.us = {backbone}!well!oster