ADC Home > Reference Library > Technical Notes > Legacy Documents > Carbon >

Legacy Documentclose button

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:

Scrap Manager Q&As

CONTENTS

This Technical Note contains a collection of archived Q&As relating to a specific topic--questions sent the Developer Support Center (DSC) along with answers from the DSC engineers. Current Q&A's can be found on the Macintosh Technical Q&A's web site.

[Sep 01 1993]






When to call GetScrap in a Desk Accessory

We're having problems with the GetScrap function in our desk accessory. After a user opens our DA, when we call GetScrap to get any text from the Clipboard, GetScrap returns -102 (no requested type in scrap). After once (or more?) through the event or SystemTask loop, the scrap suddenly shows up. What's causing this?

The reason for the trouble you're having with desk accessories and GetScrap is that you're looking for the converted scrap at the wrong time in the process. According to the MultiFinder documentation (Programmer's Guide to MultiFinder and Inside Macintosh Volume VI), an application is supposed to convert its private scrap and write it to the public scrap when it receives a suspend event. When the system opens your DA, it immediately sends it an Open message; the application hasn't received its suspend event yet. You have to wait until the scrap has been converted. This, for a DA, should occur at the first null event, and for applications, when you get a resume event.

Back to top

Clipboard window should be hidden in MultiFinder

Date Written: 11/21/89

Last reviewed: 12/17/90

I think my application is completely MultiFinder-aware and conforms to all the MultiFinder guidelines. What might I have missed?

Many developers forget one important MultiFinder feature--there is a note on page 3-3 of the "Programmer's Guide to MultiFinder" which many programmers seem to miss: "Applications should hide their Clipboard window when not running in the foreground. The contents of the Clipboard are not valid unless the application is frontmost." This means you must do more than just deactivate the Clipboard. Make it invisible--otherwise there can be multiple incarnations of the Clipboard window displayed on the screen at the same time, only one of which is necessarily current.

Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (40K).

Download



Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.