lotus

previous page: Miscellaneous Macintosh FAQ
  
page up: Macintosh Operating Systems
  
next page: Macintosh System Software FAQ

Mac Programming FAQ



Frequently Asked Questions about Mac Programming.

This FAQ about Mac Programming was compiled and written by Jon Watte h+@austin.metrowerks.com with numerous contributions by others.

-1.1) What do I need to start writing Macintosh software?
A Mac, a lot of time, and a few hundred $. Although you can develop ...
-1.2) What is the most used Macintosh development system?
Currently, the three most widely used are CodeWarrior (CW), MPW, and ...
-1.3) Okay, which is the most used Mac programming languge?
The existing Macintosh code base is mostly C, with C++ second, and ...
-1.4) Where do I find a free/share/copyleftware C compiler for the Mac? Is there a GCC for the mac? What about the FSF boycott of Apple products?
There is no really good solution for a for-free C development ...
-1.5) Are there any other free Mac development platforms?
The best source for information on free compilers/interpreters is the ...
-1.6) What's the difference between the MPW, Think and CodeWarrior environments?
As of CodeWarrior/6, MPW 3.3, and Symantec C++ 8.0.1 (SC++), ...
-1.7) What is a good low-level debugger for the Mac?
MacsBug is freely available for ftp from ; log ...
-1.8) Are there any visual developments environments for the Mac (comparable to Visual C++)?
There is no Visual C++ as such. However, there is a C++ parser/editor ...
-1.9) What class libraries are there for the Mac?
Apart from the libraries mentioned above, there are three contenders: ...
-1.1.3) Starting with Symantec C++ 7.0, Think Class Library 2.0 using templates and "real" C++ objects is shipping.
The C++ Standard Template Library (STL) compiles under Symantec C++ ...
-1.10) How should I debug and test my software? (Mac Programming)
Get ahold of, and install, the extensions DoubleTrouble, ...
-1.11) Are there any good Mac programming magazines?
One Mac programming magazine I know of is MacTech Magazine (formerly ...
-1.12) What about protected memory? I'm sick and tired of re-booting when my application crashes. (Mac Programming)
Write better software! ...
-1.13) I have this library written in (Think) Pascal that I want to use from Think C/Symantec C, but I get link errors/don't know how to do it. What should I do? (Mac Programming)
Start by writing a .h file describing the interface. Remember to ...
-1.14) CodeWarrior vs. Think/Symantec C++: Which is better?
See the above discussion on CodeWarrior, Think, and MPW for a full ...
-1.15) Can CodeWarrior read Think libraries?
Yes, in a way. Here are the steps required....
-1.16) What are some good books on the subject of learning the Mac Toolbox?
Any of Dan Parks Sydow's numerous books on the subject. Recommended ...
-1.17) Source code! I want source code! Where can I find some? (Mac Programming)
Celestin Company, Inc. sells the Apprentice 2 CD-ROM. Apprentice ...
-1.18) I'm trying to use a largish array in Think C, but get a "code overflow" error. This is valid C, why doesn't it work? (Mac Programming)
The ANSI standard does not guarantee that any structure larger than ...
-2.1) What is a handle? (Memory - Mac Programming)
A handle is a pointer to a pointer to something. However, it is more ...
-2.2) When do I have to lock a Handle? (Memory - Mac Programming)
The contents of a Handle may move, and when it does, the pointer your ...
-2.3) How do I dispose of Handles? (Memory - Mac Programming)
DisposeHandle (formerly called DisposHandle) once and ONLY once will ...
-2.4) What about resources? (Memory - Mac Programming)
Calling GetResource returns NULL if the resource is not found or ...
-3.1) How do I read the modifier keys of the keyboard? (User / Machine interaction - Mac Programming)
Just call EventAvail and check the event.modifiers field. ...
-3.2) How do I move the mouse cursor to a specific position? (User / Machine interaction - Mac Programming)
Wait! Don't do it! There has to be a better way!...
-3.3) My menus don't show up in the menu bar (User / Machine interaction - Mac Programming)
If your menus are hiearchical, you'll have to install them manually; ...
-3.4) When the user selects my menus, I get strange results back; they seem to have different menu IDs than my menus? (User / Machine interaction - Mac Programming)
The Menu ID as used by the menu manager is NOT the same thing as the ...
-3.5) I use GetMenu() to find a menu in the menu bar, and then change it, but it seems I have a memory leak OR my changes don't "punch through" (User / Machine interaction - Mac Programming)
GetMenu() is only intended if you don't already have the menu in ...
-3.6) What about pre-emptive multitasking? (User / Machine interaction - Mac Programming)
To the user, the Mac multitasking method, which builds upon each ...
-4.1) How do I tell fopen() to open a file the user has selected using StandardGetFile? (Files - Mac Programming)
The standard ANSI C file functions are less than well suited for ...
-4.2) When can I use the HOpen, HCreate etc file calls? Are they only System 7 calls? (Files - Mac Programming)
All the HXxx calls that take a vRefNum and parID as well as the file ...
-4.3) Why do you say wdRefNum sometimes and vRefNum sometimes? Why do you say parID sometimes and dirID sometimes? (Files - Mac Programming)
When the Mac first made an appearance in 1984, it identified files by ...
-4.4) How do I convert a wdRefNum as returned by SFGetFile into a vRefNum/parID pair to use with the HXxx calls? (Files - Mac Programming)
Use GetWDInfo, which is declared as: ...
-4.5) How do I select a folder using SFGetFile? (Files - Mac Programming)
This requires a custom dialog with a filter proc. It is too ...
-4.6) How do I get the full path of a file referenced by a vRefNum, parID and name? (Files - Mac Programming)
You don't. ...
-4.7) What about actually getting the full path for a file? I promise I will only use it to show the location of a file to the user! (Files - Mac Programming)
Enter PBGetCatInfo, the Vegimatic of the Mac file system. Any Mac ...
-4.8) So how do I get the names of the files in a directory? (Files - Mac Programming)
You use PBGetCatInfo again, but this time you set ioFDirIndex to 1 or ...
-4.9) How do I find the name of a folder for which I only know the dirID and vRefNum? (Files - Mac Programming)
You call (surprise!) PBGetCatInfo! Make ioNamePtr point to an empty ...
-4.10) How do I make the Finder see a new file that I created? Or if I changed the type of it; how do I display a new icon for it? (Files - Mac Programming)
You call (surprise!) PBGetCatInfo followed by PBSetCatInfo for the ...
-4.11) Aren't we done with PBGetCatInfo soon? (Files - Mac Programming)
Well, it turns out that you can also find out whether an FSSpec is a ...
-4.12) How do I set what folder should initially be shown in the SFGetFile boxes? (Files - Mac Programming)
You stuff the dirID you want to show into the lo-mem global ...
-4.13) How do I find the folder my application started from? How do I find the application file that's running? (Files - Mac Programming)
Under System 7, you call GetProcessInformation using the ...
-4.14) When can I use those nifty, easy to use FSSpec calls? (Files - Mac Programming)
In Systems >= 7, in System 6 with QuickTime installed, in any system ...
-4.15) I hate dealing with the low-level file manager stuff; why didn't Apple provide a complete high-level interface using FSSpecs? (Files - Mac Programming)
Good question. Apple, in the guise of Jim Luther of Mac Developer ...
-5.1) Why is CopyBits so slow? (Imaging with QuickDraw - Mac Programming)
It is not. It just requires some hand-holding to get good results. ...
-5.2) Why is CopyBits still too slow? (Imaging with QuickDraw - Mac Programming)
Because there is always some overhead involved in calling QuickDraw; ...
-5.3) What is the fastest way to set one pixel? (Imaging with QuickDraw - Mac Programming)
On 68k Macs, NOT SetCPixel()! Assuming you have the correct ForeColor() ...
-5.4) Why do pictures I record suddenly draw as empty space or not draw at all? (Imaging with QuickDraw - Mac Programming)
When recording pictures, you have to set the clipping area to exactly ...
-5.5) Where can I find the format of picture files and resources? (Imaging with QuickDraw - Mac Programming)
The format of a picture resource version 1 is defined in a technical ...
-5.6) GWorlds? (Imaging with QuickDraw - Mac Programming)
What about them? They're great. Look them up in IM: Imaging With ...
-5.7) How do I find the current depth of the screen? (Imaging with QuickDraw - Mac Programming)
My question to you is: What screen? Many macs have more than one ...
-5.8) Why is it a bad idea to draw directly to screen? (Imaging with QuickDraw - Mac Programming)
Because of several reasons: ...
-5.9) But I really need to do it. I can't make my animation into a QuickTime movie, and CopyBits is too slow, even when syncing to the screen retrace and with my source GWorld aligned properly. (Imaging with QuickDraw - Mac Programming)
You have to prepare yourself, and ask these questions: ...
-5.10) Okay, so how do I get the base address of the screen? (Imaging with QuickDraw - Mac Programming)
The screen? Which screen? There may be several. The base ...
-5.11) Quit stalling and give me code! (Imaging with QuickDraw - Mac Programming)
Okay, but I'll let you sweat over Inside Mac to figure out ...
-6.1) How do I get TextEdit to display more than 32k of text? (Text - Mac Programming)
You don't. Truly, it's not worth it. There's a call-for-call ...
-6.2) How do I get TextEdit to display more than 32k of __styled__ text and embedded objects in the text (such as pictures)? (Text - Mac Programming)
WASTE, available at ftp://ghost.dsi.unimi.it/pub2/papers/, is a ...
-6.3) I'm too back-asswards to use WASTE 1.1. How do I include pictures in text using TextEdit? (Text - Mac Programming)
There's no really easy way (such as a TEAddPict() call), and it will ...
-6.4) I have all this money, and I want to get rid of it. How do I edit more than 32k of styled text now? (Text - Mac Programming)
There are at least three solutions....
-6.5) How do I convert from a string to a floating point type? (Text - Mac Programming)
Once you've got an Str255, you want to call the routine ...
-7.1) How do I get at the serial ports? (Communications and Networking - Mac Programming)
You call OpenDriver for the names \p.AOut and \p.AIn to get at ...
-7.2) Where is a Berkley sockets library for the Mac?
There are some problems with that. MacTCP, the Mac Toolbox ...
-7.3) Where do I find MacTCP?
You can buy the MacTCP developers kit from APDA. It is also ...
-7.4) I'm trying to write to the serial port. It works fine on the following Machines, Quadra700, IIFX, Powerbook 170, Quadra 840av, but freezes on the Duo 230 and 280c. (Communications and Networking - Mac Programming)
You need to call SerHShake. Otherwise you get screwed on some ...
-8.1) What are AppleEvents? (IAC - Mac Programming)
AppleEvents are a level-5 network protocol. If you are not familiar ...
-8.2) What are the four required AppleEvents? (IAC - Mac Programming)
There are four events your application really must implement if you ...
-8.3) Are there any limits or tradeoffs with AppleEvents? (IAC - Mac Programming)
As always, more power means more responsibility. ...
-8.4) How do AppleEvents interface with AppleScript? (IAC - Mac Programming)
AppleEvents are the meat and potatoes of AppleScript. If you support ...
-8.5) Can I compile and run scripts from within my application? (IAC - Mac Programming)
Yes, this is very simple. There are toolbox calls for reading ...
-8.6) Is this a good way of getting a macro language almost for free? (IAC - Mac Programming)
Good is an understatement. Just let users write scripts, load them ...
-8.7) Why do I get error -903 (noPortErr) when I try to send an Apple Event? (IAC - Mac Programming)
Make sure the isHighLevelEventAware flag in your application's SIZE ...
-9.1) How do I do code resources/extensions/external functions, much like HyperCard XCMDs only for my 68k app/extension? (Standalone Code & Trap Patching - Mac Programming)
Here is what you need to do:...
-9.2) How do I fat-patch a trap (that is, how do I patch a trap with both 68k and PPC code)? (Standalone Code & Trap Patching - Mac Programming)
Create a normal fat routine descriptor and pass it to ...
-10.1) I see all these people call Gestalt without first checking whether it's implemented. Isn't that bad? (Compatibility - Mac Programming)
No; Gestalt and a few other traps (the HXxx file manager ...
-10.2) What more functions are implemented in glue? (Compatibility - Mac Programming)
Wake Up and Smell the Glue!...
-10.3) I have to support System 6, don't I? (Compatibility - Mac Programming)
It would be foolish to lock yourself out of the many benefits ...
-10.4) Why does my application work on an SE with accellerator (or a Mac II or Quadra), but not on one without? (Compatibility - Mac Programming)
Assuming you're not calling Color QuickDraw (which is not ...
-10.5) Why does my application work on a IIci and a pre-1995 PowerMac but not on a Quadra? (Compatibility - Mac Programming)
Two reasons: ...
-10.6) Why does my application work on my Quadra but not on my accellerated SE? (Compatibility - Mac Programming)
You're probably calling Color QuickDraw without first checking if it's ...
-10.7) I do check for color quickdraw, but crash nevertheless. (Compatibility - Mac Programming)
_Gestalt lies under some versions of System 7; it says that non-color ...
-11.1.1) I want to write a Amiga QuickTime player and need the CODEC format details. (Optional System Software - Mac Programming)
Although the structure of QuickTime movies is well documented in ...
-12.1.1) What are some royalty-free databases available for the Macintosh? (Third-Party Solutions - Mac Programming)
These are commercial with no run-time licenses:...
-12.1.2) I need a robust Client/Server database library. What do I do? (Third-Party Solutions - Mac Programming)
Get the Macintosh Client/Server Database Development Summary, by Liam ...
-12.2.1) Help! The List Manager is driving me right UP THE WALL! I want to throw it out and start over. What'r my options? (Third-Party Solutions - Mac Programming)
The only non-framework List Manager replacement of which I'm aware is ...
-13.1) Dessert? (Third-Party Solutions - Mac Programming)
Honey Hill Farms Cookie Jar Frozen Yoghurt or Haagen-Dazs Raspberry & ...
-14.) Contributors (Mac Programming FAQ)
[do let me know if I've forgotten you]...







TOP
previous page: Miscellaneous Macintosh FAQ
  
page up: Macintosh Operating Systems
  
next page: Macintosh System Software FAQ