Chapter 23 In-Place Objects

ACTIVE INGREDIENT: tetrahydrozoline hydrochloride, 0.05%

Many medicines contain only a tiny amount of the key ingredient. For example, I have on my desk a small bottle of eye drops that I grabbed from the medicine cabinet. Of the 14.7 ml of liquid in this bottle, only a minuscule 0.00735 ml is the active ingredient; the rest is water. The addition of only a small amount of an active ingredient turns the liquid in the bottle into something of real value.

Compound document content objects are often the same way—the presence of a little feature can distinguish one from the rest of the crowd. If a content object is merely a small bottle of water, what will set it apart from the ocean of other content? A little bit of an active ingredient, such as in-place activation. Compared with the rest of a content object, the percentage of extra code necessary to implement in-place support is extremely small. Overall, it's nothing like what we had to do to create a container application in Chapter 22. Most of the work for activating an object in place, as you might imagine, is in building up and tearing down the in-place user interface, such as the shared menu and the in-place tools that we discussed in the first half of Chapter 22. Some objects need no such user interface, making the entire process even easier.

Because Chapter 22 already discussed the mechanics of in-place activation, this chapter is concerned with implementation. We'll add in-place capabilities to Cosmo and to Polyline, both of which we last saw in Chapter 21. As we'll see, almost the same steps apply to both local and in-process servers and their objects. One difference is that Polyline is marked as an activate-when-visible object, allowing you to explore that feature with Patron from Chapter 22. So if you're ready, let's see what we can accomplish with just a few drops of the programming equivalent of tetrahydrozoline HCl.