ADC Home > Reference Library > Technical Notes > Legacy Documents > Mac OS 9 & Earlier >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
|
Extending MacApp FailOSErr call to include additional error strings
Is there any way to extend the
This is what happens:
To handle MacTCP errors, add a MacApp "internal component is missing" compilation messageDate Written: 3/12/93 Last reviewed: 6/24/93 When starting a new MacApp program, I get the message "Couldn't create new document because an internal component is missing. Please contact the developer." How do I find out which component is missing? When building a -nodebug version of an application, MABuild assumes that the code is as optimized as possible, including making the code as small as possible. Therefore the linker strips out any unused code from the final application.
The problem is that the linker determines which code is to be stripped out by
finding all objects that are constructed with the "new" operator. Objects
derived from TView are instantiated through calls to
MacApp defines a macro that makes this easy for you to trick the linker. Place
this line of code in your implementation of
MacApp takes care of this for you for any View classes defined by MacApp, but
you do have to do it for any subclasses of More information about this can be found in the MacApp tutorial (C++) on page 166, and in the MacApp AppleLink archives. MacApp hierarchical menu ID range is 1-63Date Written: 2/24/93 Last reviewed: 4/9/93 Submenus aren't working correctly in my application. I'm using MacApp and my 'CMNU' and 'MBAR' resources are set up correctly. The submenu appears to be set up properly in the hierarchical menu bar. The main menu highlights in response to a command key for its submenu, but the submenu never shows up when selected. How can this be? You'll see this behavior if your hierarchical menu IDs are greater than 63. MacApp requires that hierarchical menus be in the range of 1-63. For more information on menus, look at the "Working with Menus" chapter in the Programmer's Guide to MacApp. Use MacApp 3 "-NeedsSystem7 Mabuild" flag for System 6Date Written: 1/6/93 Last reviewed: 6/14/93 Now that I've converted my application from MacApp 2 to MacApp 3, it doesn't run under System 6, even when I don't compile for large model addressing. What switches or options do I need to observe for a System 6 application?
Your MacApp program will run under System 6 if you use MABuild's - Why MacApp uses Initialize and Free methodsDate Written: 11/20/92 Last reviewed: 6/14/93 Why does MacApp use the Initialize and Free methods instead of the normal C++ constructor and destructor methods? MacApp doesn't use constructors for historical reasons. Object Pascal was used in MacApp 2.0.1, which doesn't have constructors and destructors as part of the language, and as a result these facilities had to be provided as part of MacApp instead of the language. MacApp 3.0 designers tried to accomplish backward compatibility with applications written with older versions of MacApp based on Object Pascal. Because of this, the designers decided to stay with the Initialize and Free functions rather than just have an instance of the objects declared and destroyed with new and free. Which headers to use for MacApp program developmentDate Written: 9/15/92 Last reviewed: 6/14/93 As a MacApp developer, am I supposed to be using the .h files in the MPW: Interfaces folder, or the ones in the {MacApp}CPlusIncludes folder?
As a default, MacApp first searches through the {MacApp}CPlusIncludes folder
for header files specified in your source, so we suggest using the
MacApp developer technical support optionsDate Written: 10/27/90 Last reviewed: 11/16/92 Is there a special address for MacApp technical support or is the Developer Support Center the correct target? For Apple Partners and Associates, DEVSUPPORT is an option, though there are also other avenues of tech support for MacApp programmers as well. First there are the group addresses MacApp2Tech$ and MacApp3Tech$. These are groups of MacApp developers on AppleLink that ask and answer questions of each other. You can simply send your questions to that address and request replies back to your personal account, or you can join a group and receive copies of all the mail sent to it by sending a request to MacApp.Admin. Another avenue of support is from MADA. This is a nonprofit organization set up by MacApp lovers. It's got about 1500 members across the nation, and even has a European counterpart. It has an annual MADA conference and a bimonthly magazine. If you are interested, call them at (206) 253-2765, or write to them at AppleLink address MADA. Annual fee is $75. Debugging options for C++Date Written: 11/28/90 Last reviewed: 6/14/93 What is the C++ equivalent for the {$D+/-} Object Pascal compiler directive? I'd like the same debugging options for C++ that exist for Object Pascal. The MacApp debugger is supported with C++ Object Pascal object information. In other words, you can't trace other objects than those derived from PascalObjects.
This works OK if you include a "-trace on" or "-trace always" with We did some testing, and it seemed to work OK. In general the S (stack info) command with the MacApp debugger has a lower signal/noise ratio than the R (recent PC) command concerning useful information, but both work OK. Extracting text from MacApp TEditText views in dialogsDate Written: 6/1/91 Last reviewed: 6/14/93
Where/when is the best place to extract text from my fill-in-the-blank
Macintosh dialog with several
You can get one answer to this by looking in the
%_BP and %_EP routinesDate Written: 6/17/91 Last reviewed: 6/14/93 When I attempt to link my program, the linker complains about %_BP and %_EP being undefined. What are these routines? Why are they needed? Why are they not being found? __The functions %_BP and %_EP are special routines that are conditionally called at the beginning and end of each procedure or function. This is designed for use by the MacApp debugger, which uses these calls to follow the execution of the code being debugged. You can also put them to any purpose you wish, such as profiling. Whether the calls to these routines are inserted is controlled through compiler directives: in MPW C, you can use the #pragma trace on|off directive to specify whether you wish these calls to be inserted. This can also be done with the compiler option -trace on|off|always|never, which makes the default state either on or off (the always and never options also override the #prgama trace directives). In MPW Pascal, you can control this feature with the {$D++} (which turns the calls on) and {$D--} (which turns them off) directives. Generally, the routines themselves are supplied by a library you link with, such as the MacApp debugger or a profiling tool, so you won't need to write your own. If however, you decide to use this feature for your own devious purposes, here's how. The procedures called are passed no arguments, and so should be defined as follows: in MPW C: or in MPW Pascal: The only difficulty is that neither C nor Pascal allows you to create a function that begins with a % sign. Thus, you need to explicitly tell the linker to treat your functions, BP and EP, as %_BP and %_EP. To do this, add the options -ma BP=%_BP -ma EP=%_EP to your link statement, and all will be well. Saving window state in pre-3.0 MacAppDate Written: 8/23/91 Last reviewed: 9/17/91 How do I save new window size and location in a TWindows resource so it can be reused next time this window is opened or created? To save your window state in a MacApp application, your implementation needs to do the following:
In the document class, add some fields for keeping track of the state, as in the following code:
The
In the
Inside
Finally, you need to save the
All this is slightly different in MacApp 3.0, because locations are in The LACS example in develop also has code that shows how to store and restore the window location information. X-Ref: "Asynchronous Background Networking on the Macintosh," develop #2:1, Winter 91 MacApp libraries: Building debug versionsDate Written: 11/18/91 Last reviewed: 12/12/91 I'm having problems building debug versions of the MacApp library ("-NeedsFPU -Debug" and others)--particularly with the UDebug.p unit, and its references to "Notification" structures. Is there a fix? Assuming that you are using MPW 3.2, the solution to your problem is documented in the MacApp 2.0.1 Release Notes dated September 28, 1990, located on the E.T.O. #5 CD. On page 18 is the following excerpt: There are several incompatibilities between MPW 3.2 and 3.1. If you wish to use MPW 3.2 with MacApp, in the file "Startup," comment-out the line: This should work with beta and final versions of MPW 3.2, although it's only been verified with MPW 3.2b3, which was available at the time. However, if you are developing on the Macintosh Quadra computers with MacApp 2.01 or MacApp 3.0 (versions prior to b3) and are using -NeedsFPU or -Debug you may have a problem with crashing. The workaround is to comment out the following lines in procedure InstallInterceptors found in UDebug.incl.p, which installs LineF exception handlers:
Versions beginning with 3.0b3 no longer have this code.
The reason for commenting this code out is that the 68040 has a subset of the
instructions handled by the 68881/68882. Missing instructions must be emulated
via the Avoiding odd-address errors on 68000-based systemsDate Written: 4/30/91 Last reviewed: 5/20/91
My application crashes on Macintosh SE but not Macintosh II systems while
attempting to read a block of code into memory and parse it. The routine passes
a pointer created by
You can get odd-address errors with 68000-based machines. Starting with 68020 the CPU is able to fetch data from odd addresses. Anyway, it's a common problem to get into trouble with data fetched from odd addresses with 68000-based platforms. Possibly the data you are saving and later retrieving has odd length, causing the next fetch to start on an odd address.
To guarantee that the data will always start on even boundaries, use the MacApp
The function tests if the pointer is pointing at an odd address, and if so it increases the pointer one byte. You could do something similar in your member function, such as:
DAs shouldn't be written in MacAppDate Written: 4/29/91 Last reviewed: 6/21/91 Where can I find information about writing a desk accessory (DA) in MacApp? First, take a look at the Macintosh Technical Note "Inside Object Pascal," which explains why, as an application framework, MacApp should be used to write only applications and MPW tools. Apple's on-line MacApp forum and the MacApp Developers' Association (MADA) are good points of contact for exchanging information about MacApp development. Contact MacApp.Admin on AppleLink for details about the MacApp forum. MADA can be reached at (206) 253-2765 or AppleLink address MADA.
MacApp
|
Acrobat version of this Note (51K). |
|