The history of The Valley has never lacked the dramatic element, and in this, the latest episode, it has held to its traditions. For consider the circumstances. This was to be our final season in The Valley. Six full seasons we had excavated there, and season after season had drawn a blank; we had worked for months at a stretch and found nothing, and only an excavator knows how desperately depressing that can be; we had almost made up our minds that we were beaten, and were preparing to leave The Valley and try our luck elsewhere; and then—hardly had we set a hoe to ground in our last despairing effort than we made a discovery that far exceeded our wildest dreams. Surely, never before in the whole history of excavation has a full digging season been compressed within the space of five days.
—Howard Carter, from The Discovery of the Tomb of Tutankhamen
In the early years of the twentieth century, Egyptologists were busy scouring the Valley of the Kings in the Egyptian desert, hoping they would find the undiscovered tombs of the pharaohs before tomb robbers plundered their rich history. The Valley had already, centuries earlier, surrendered the tombs of kings such as Ramses VI and Seti II. In the area of the tombs, Howard Carter and other archaeologists found clues indicating that there might be other, still-hidden, tombs. One name that appeared in a few circumstances was that of the boy-king Tutankhamen. By the fall of 1917, Carter and his benefactor, Lord Carnavon, had decided to begin a systematic search of the rubble in the area in which they hoped to find Tutankhamen's tomb. In Carter's words, "The difficulty was to know where to begin, for mountains of rubbish thrown out by previous excavators encumbered the ground in all directions, and no sort of record had ever been kept as to which areas had been properly excavated and which had not."
Six long seasons they dug, finding nothing. All their hopes were spent. All their work had gone for naught. All the time spent piecing together clues to figure out even where to dig had gone unrewarded. But on the morning of November 4, 1922, Carter arrived at the site to find a strange silence, a void of activity that suggested something unusual, perhaps something extraordinary. A mere 13 feet downhill from the well-known entrance to the tomb of Ramses VI, Carter's workers had uncovered a step cut in the rock. Subsequent clearing unearthed 16 steps leading down to a sealed doorway, the seal unbroken since it was applied millennia earlier. But was it the tomb Carter was searching for? Or was it merely the tomb of a noble? Further painstaking work revealed that Carter had indeed discovered the tomb of King Tutankhamen. Carter's discovery enabled the modern world to behold all the wonderful treasures that had lain locked beneath the desert for over 3000 years.
In searching for the tomb, Carter had a most difficult time. While he was drawing his sketchy treasure map, he really didn't know where the treasure was. Even after he completed his map, he put in many passionate years of toil trying to follow it, searching and hoping for a tomb beneath the sand. Few of us would have such patience and perseverance—certainly not modern computer users. They simply do not want the hassle of tracking down the sources of linked objects.
Fortunately, computers are much more precise than Carter's rudimentary tools when it comes to creating and following treasure maps to the source of a link. In the best traditions of object-oriented programming, if you want a map to some treasure, you simply ask the treasure to make one for you. That's precisely what happens with a link source. The source is responsible for providing monikers that other components can use to reconnect (bind) to that source—the moniker is a treasure map that knows how to follow itself and bring back the treasure. We saw in Chapter 20 how a container makes use of a moniker in a linked content object. Now we can investigate the means through which a source provides a moniker to name its own treasures. In Chapter 9, we explored the moniker binding process in detail; here we'll see the additional support a source must provide to make linking work in the context of OLE Documents.
First we'll update the Cosmo sample from Chapter 18 so that it provides a simple file moniker as its link source. Then we'll enhance Patron so that it supplies a File!Item!Item moniker to support linking to embeddings. In this way, Patron itself becomes a server to the embedded objects contained within its documents, and the moniker names specific objects on a specific page in a specific document. Patron's document and page objects—up to now, nothing more than internal C++ objects—become OLE objects with the necessary interfaces to support moniker binding. This is nontrivial work, but it's certainly not as difficult as digging through rubble for six years. And to end users, the treasures held in embedded objects are often more valuable than the treasures of an Egyptian pharaoh.