Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!usc!apple!ksand From: ksand@Apple.COM (Kent Sandvik) Newsgroups: comp.sys.mac.programmer Subject: Re: C++ programming under MPW - advice sought Message-ID: <47268@apple.Apple.COM> Date: 11 Dec 90 18:54:41 GMT References: <1082@exua.exeter.ac.uk> Organization: Apple Computer Inc., Cupertino, CA Lines: 63 In article <1082@exua.exeter.ac.uk> kt@msor.msor (Keith Tizzard) writes: >I am trying to use C++ under MPW and would welcome some advice and help. >The C++ language creates no problem since I have used it in other environments. >The problem comes when I try to find out about the MacApp classes and their >methods. >Where do I look for a clear description? >Do I need to acquire and read all the volumes of Inside Macintosh? You don't need to learn all the internals of Mac, but it sure helps to understand how the drawing (QuickDraw), memory management (Memory Manager), the file system (File Manager) and the resources (Resource Manager) works. This because you need to use these in your MacApp source code. The rest is taken care by MacApp. >Is there a class browser to enable me to find out, quickly and easily >what classes are available to inherit and what member functions they contain? MacBrowse is part of the MacApp 2.0 release. It's very, very useful. >In the APDAlog I note the publications: >C++ Programming with MacApp by David Wilson, Larry Rosenstein and Dan Shafer >Elements of C++ Macintosh Programming by Dan Weston Get both! >Let me illustrate my difficulty. >The following code is taken from ShapesApp.cp, one of the files in the >distributed C++ examples which come with MPW. Reading the code is difficult >and the thought of creating new code is awe inspiring. Within the class >constructors and member functions very little appears to be object orientated. >In the following member function why do we have: ? > >EnableItem(menu, iNew); instead of menu->EnableItem(iNew) >DisableItem(menu, iClose); instead of menu->DisableItem(iClose); > >menu = GetMHandle(mFile); instead of menu = mFile->GetMHandle(); Some parts of the MacApp framework are not so object oriented, there are many reasons for this, like historical ones, or performance reasons. And ultimately the framework must call the Toolbox, which is not layered in an object oriented way. >When using a set of existing classes, easily accessible documentation is needed. >By that I mean, a list of all the classes together with their member functions >plus a clear description of what each one does. The document called "MacApp 2.0 Class and Method Reference" contains this information. In general I would recommend to order all the APDA MacApp documentation. And speaking from personal experience learning new frameworks, using a browser (MacBrowse) is the best tool for this. Hope this helped a little bit. Regards, Kent Sandvik -- Kent Sandvik, Apple Computer Inc, Developer Technical Support NET:ksand@apple.com, AppleLink: KSAND DISCLAIMER: Private mumbo-jumbo Zippy says: "With C++ we now do have the possibilities to inherit dangling pointer problems"