I placed a large amount of what, where?
- 5 minutes read - 851 wordsSo this is a thing I’ve been asked a couple of times, honest. From time to time, applications (especially Microsoft Office applications) ask a question that seems impossible to answer.
Well, alright, quite regularly, but there is one question in particular that I’m thinking of here. That question is the one about “You placed a large amount of data on the clipboard…”, and looks like this:

So, what on earth is that about? Well, basically it’s a side-effect of how the clipboard works. Which kind of isn’t how you might think it works. Consider, if you will, what happens when you copy from one application (the source) and paste to another (the destination). You might think (as I did) that when you cut or copy the data from the source, it’s put on the clipboard, and when you paste, the destination pulls from the clipboard into itself. And that’s basically right, but it’s a bit more complicated than that.
When you cut or copy (it’s basically the same), the source application has to work out what you’ve selected, and translate it into one or more formats that it can put onto the clipboard. These formats are independent of any particular application, and are to do with what Windows states allowable clipboard formats are. (Private formats are allowed too, but that’s outside the scope of this discussion). This translation is known as rendering, and can be very processor-intensive, depending on the exact detail going on. Applications can also choose to put the data on the clipboard in more than one format, which is more useful for you the user, but takes even longer to render. When you paste, the destination application looks at all of the available formats, chooses the best one for its own purposes, and translates it from the clipboard format to its own format, and shows the results in your document.
You might, at this point, wonder why all of this translation is necessary. It’s because each application is free to hold documents in its own format, but this private format needs to be translated into something more universal before it can be used elsewhere. But the application puts its private format on the clipboard too, just in case you are cutting and pasting between documents in the same application. It’s all about trying to retain as much of the information as possible when cutting and pasting, on the assumption that maintaining the information is what you want.
Thus far, everything is OK. With the above, you can cut and paste between applications. However, as we said earlier, there’s lots of translation going on, and this translation is expensive in terms of CPU time. And, of course, chances are that you’ll only ever use one of the rendered formats on the clipboard. This raises the question of why should we do work that almost certainly won’t be used? After all, it’s not guaranteed that just because you’ve put something on the clipboard, that you’ll use it. Some people use ‘cut’ as a synonym for ‘delete’, after all.
To answer that question, there’s a different mechanism available. Basically, this mechanism allows the source application to register a callback. This callback essentially says, “When the user asks for the clipboard information in this format, call me at this number!” The source application doesn’t need to do all of the usual rendering, so it saves time. When the user goes to the destination application and selects “Paste”, then the callback is invoked, the source application does the rendering, and then the destination application can copy out the data, process it as it wants to, and we’re all done. Interestingly, the destination application ends up seeming slower here, when at least part of the delay is the source application doing the rendering it promised to do.
All of this is fine, but there’s one potential problem. If an application hasn’t used the callback mechanism, and has instead put the data on the clipboard in full, then it doesn’t matter if the source application is running or not when the user does the paste. But, if the callback mechanism is in use, there will be a problem if the source application isn’t running when the user tries to do a paste into the destination application. To try and avoid this problem, if you attempt to quit a the source application when it has a pending callback, then the application needs to warn you that this could cause a problem — because the application won’t be around to answer the callback.
And that’s what it means by “You placed a large amount of data on the clipboard…”. If you say “No”, then the source application clears the clipboard, and that is that. If you say “Yes”, meaning that you do want the application data, then the source application has no choice but to replace the callbacks with the actual, fully-rendered data, in each format that it promised. And that can take a while, which is why the application didn’t want to do that in the first place. Hence the application takes ages to shut down.