Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!cbnewsk!ech From: ech@cbnewsk.ATT.COM (ned.horvath) Newsgroups: comp.sys.mac.programmer Subject: Re: Think C 4.0 questions Message-ID: <1968@cbnewsk.ATT.COM> Date: 6 Feb 90 22:42:57 GMT References: <10682@bsu-cs.bsu.edu> Organization: AT&T Bell Laboratories Lines: 42 From article <10682@bsu-cs.bsu.edu>, by mithomas@bsu-cs.bsu.edu (Michael Thomas Niehaus): > I have several questions that I hope someone out there can answer: > > 1. If you declare an array in an object class definition, is it safe to > use that array in a call to, say, an FSWrite routine? I have created > a 1K buffer and when it fills up I want to call FSWrite to write the > whole chunk out. Is this safe, or do I have to copy the whole array? > (Or can I lock it down?) Lock the object: FSWrite can move memory, and TC4 objects are relocatable. > 2. If you declare a superclass and then two or more subclasses, is it > possible to create an object of one subclass and assign it to an object > variable of the superclass? I would like to have an array of objects of > different types (but of similar structures). Yes, that's what polymorphism is all about. The reverse is not, in general, true (i.e. don't try to assign an object to one of it's subclasses). You CAN do this, but it's best to poll the object for it's type, to make sure that the assignment is compatible (TC4 supports this). > 3. What does the debugger look like? (My poor little 1MB SE has never seen > it.) It's not perfect, but it's very very nice. Go spend the $300 for the 4Mb, you'll be glad you gave up the pizzas. > 4. How would you change the font that is used in a dialog's buttons to > something other than Chicago? RTFM. IM, Dialog Manager chapter, use SetDAFont to set the font for subsequent dialogs. Control Manager chapter (IM I-315): add 8 (useWFont) to the control definition ID to use the windows font. Caveat: I haven't tried either this. > 5. Does anyone have any source to convert BinHex->Mac files? I am basically > looking for a routine that will accept two file reference numbers and > do the work, and hacking the xbin source currently looks like a headache. Nope. =Ned Horvath=